summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-21 11:14:24 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-23 13:04:54 +0000
commit5c78fef54a595da1be1b395f4ab4533e345a8c04 (patch)
tree0b475a9033e5a29cc423084415e8370d7a9535b3
parent1b2559ab57da944e92f93db61a0a322642cd0b31 (diff)
downloadbundler-5c78fef54a595da1be1b395f4ab4533e345a8c04.tar.gz
Move Rubocop development dependency into gemspec
Now that Bundler no longer supports Ruby <2.3, the Ruby minimum version requirement that prevented Rubocop from being specified as a development dependency in the gemspec no longer applies. Having Rubocop in the gemspec is useful for tools like RubyGems.org or Bundix that use it as the source of truth for dependencies.
-rw-r--r--Rakefile11
-rw-r--r--bundler.gemspec1
2 files changed, 4 insertions, 8 deletions
diff --git a/Rakefile b/Rakefile
index 746d110f86..21b11b9e59 100644
--- a/Rakefile
+++ b/Rakefile
@@ -43,7 +43,6 @@ namespace :spec do
deps = Hash[bundler_spec.development_dependencies.map do |d|
[d.name, d.requirement.to_s]
end]
- deps["rubocop"] ||= "= 0.50.0" if RUBY_VERSION >= "2.0.0" # can't go in the gemspec because of the ruby version requirement
# JRuby can't build ronn or rdiscount, so we skip that
if defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
@@ -95,13 +94,9 @@ begin
RSpec::Core::RakeTask.new
task :spec => "man:build"
- if RUBY_VERSION >= "2.0.0"
- # can't go in the gemspec because of the ruby version requirement
- gem "rubocop", "= 0.50.0"
- require "rubocop/rake_task"
- rubocop = RuboCop::RakeTask.new
- rubocop.options = ["--parallel"]
- end
+ require "rubocop/rake_task"
+ rubocop = RuboCop::RakeTask.new
+ rubocop.options = ["--parallel"]
namespace :spec do
task :clean do
diff --git a/bundler.gemspec b/bundler.gemspec
index 12b1b59b98..3a87b8713c 100644
--- a/bundler.gemspec
+++ b/bundler.gemspec
@@ -46,6 +46,7 @@ Gem::Specification.new do |s|
s.add_development_dependency "rdiscount", "~> 2.2"
s.add_development_dependency "ronn", "~> 0.7.3"
s.add_development_dependency "rspec", "~> 3.6"
+ s.add_development_dependency "rubocop", "= 0.50.0"
base_dir = File.dirname(__FILE__).gsub(%r{([^A-Za-z0-9_\-.,:\/@\n])}, "\\\\\\1")
s.files = IO.popen("git -C #{base_dir} ls-files -z", &:read).split("\x0").select {|f| f.match(%r{^(lib|exe)/}) }