summaryrefslogtreecommitdiff
path: root/lib/bundler/cli
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2018-03-24 19:19:00 -0700
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-10-19 20:27:43 +0200
commitf821c754ba7b4048cb37141992a32daee1cd58e7 (patch)
treef7f9c27b6ee77b1dccaf6b606f08e6aac425b7a9 /lib/bundler/cli
parentc9d16351b4e2a8a41ce9e3a812b7612970b25a78 (diff)
downloadbundler-f821c754ba7b4048cb37141992a32daee1cd58e7.tar.gz
[CLI::Gem] Add a --rubocop optionsegiddins/bundle-gem-rubocop-option
Diffstat (limited to 'lib/bundler/cli')
-rw-r--r--lib/bundler/cli/gem.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb
index d3e5831759..403005a6bd 100644
--- a/lib/bundler/cli/gem.rb
+++ b/lib/bundler/cli/gem.rb
@@ -100,7 +100,7 @@ module Bundler
end
end
- config[:test_task] = config[:test] == "minitest" ? "test" : "spec"
+ config[:test_task] = config[:test] == "minitest" ? :test : :spec
if ask_and_set(:mit, "Do you want to license your code permissively under the MIT license?",
"This means that any other developer or company will be legally allowed to use your code " \
@@ -124,6 +124,15 @@ module Bundler
templates.merge!("CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md")
end
+ if ask_and_set(:rubocop, "Do you want to add rubocop as a dependency for gems you generate?",
+ "RuboCop is a static code analyzer that has out-of-the-box rules for many " \
+ "of the guidelines in the community style guide. " \
+ "For more information, see the RuboCop docs (https://docs.rubocop.org/en/stable/) " \
+ "and the Ruby Style Guides (https://github.com/rubocop-hq/ruby-style-guide).")
+ config[:rubocop] = true
+ Bundler.ui.info "RuboCop enabled in config"
+ end
+
templates.merge!("exe/newgem.tt" => "exe/#{name}") if config[:exe]
if options[:ext]