summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-01-24 00:18:27 +0000
committerColby Swandale <me@colby.fyi>2019-04-01 22:48:01 +1100
commit74ed4a8d79f45170db07799aa44831b947e2d3d6 (patch)
tree9b0474520544d7b3e87eecafb3a2cc0b73413b8d
parentd92c08cde859b270b903ff3b329426b7e38da2d1 (diff)
downloadbundler-74ed4a8d79f45170db07799aa44831b947e2d3d6.tar.gz
Merge #6926
6926: Move Rubocop development dependency into gemspec r=hsbt a=alyssais The problem was that tools like RubyGems.org or Bundix that use the gemspec as the source of truth for dependencies didn't pick up on the development dependency on Rubocop. My diagnosis was that the reason for this, which was that Rubocop had a minimum Ruby version of 2.0.0, was no longer an issue, since Bundler 2 doesn't support Rubies that old anyway. My fix was to move the Rubocop requirement into the gemspec. I chose this fix because it addresses the problem I was having, feels right, and the old workaround doesn't look like it's necessary any more. Co-authored-by: Alyssa Ross <hi@alyssa.is> (cherry picked from commit e58436ef762ef1120024bbcda2620637f0484547)
-rw-r--r--Rakefile10
-rw-r--r--bundler.gemspec1
2 files changed, 4 insertions, 7 deletions
diff --git a/Rakefile b/Rakefile
index 4710ffbdc5..1254bf2149 100644
--- a/Rakefile
+++ b/Rakefile
@@ -40,7 +40,6 @@ namespace :spec do
deps = Hash[BUNDLER_SPEC.development_dependencies.map do |d|
[d.name, d.requirement.to_s]
end]
- deps["rubocop"] ||= "= 0.49.1" 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"
@@ -92,12 +91,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.49.1"
- require "rubocop/rake_task"
- RuboCop::RakeTask.new
- 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 2886042bbf..bf0d532c01 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)/}) }