lib/bundler/cli/gem.rb in bundler-2.5.14 vs lib/bundler/cli/gem.rb in bundler-2.5.15
- old
+ new
@@ -30,11 +30,10 @@
@extension = options[:ext]
validate_ext_name if @extension
validate_rust_builder_rubygems_version if @extension == "rust"
- travis_removal_info
end
def run
Bundler.ui.confirm "Creating gem '#{name}'..."
@@ -274,10 +273,11 @@
"https://guides.rubygems.org/gems-with-extensions/\n"
exit 1
end
def ask_and_set_test_framework
+ return if skip?(:test)
test_framework = options[:test] || Bundler.settings["gem.test"]
if test_framework.to_s.empty?
Bundler.ui.confirm "Do you want to generate tests with your gem?"
Bundler.ui.info hint_text("test")
@@ -299,20 +299,25 @@
end
test_framework
end
+ def skip?(option)
+ options.key?(option) && options[option].nil?
+ end
+
def hint_text(setting)
if Bundler.settings["gem.#{setting}"] == false
"Your choice will only be applied to this gem."
else
"Future `bundle gem` calls will use your choice. " \
"This setting can be changed anytime with `bundle config gem.#{setting}`."
end
end
def ask_and_set_ci
+ return if skip?(:ci)
ci_template = options[:ci] || Bundler.settings["gem.ci"]
if ci_template.to_s.empty?
Bundler.ui.confirm "Do you want to set up continuous integration for your gem? " \
"Supported services:\n" \
@@ -340,10 +345,11 @@
ci_template
end
def ask_and_set_linter
+ return if skip?(:linter)
linter_template = options[:linter] || Bundler.settings["gem.linter"]
linter_template = deprecated_rubocop_option if linter_template.nil?
if linter_template.to_s.empty?
Bundler.ui.confirm "Do you want to add a code linter and formatter to your gem? " \
@@ -444,22 +450,9 @@
"1.21"
end
def standard_version
"1.3"
- end
-
- # TODO: remove at next minor release
- def travis_removal_info
- if options[:ci] == "travis"
- Bundler.ui.error "Support for Travis CI was removed from gem skeleton generator."
- exit 1
- end
-
- if Bundler.settings["gem.ci"] == "travis"
- Bundler.ui.error "Support for Travis CI was removed from gem skeleton generator, but it is present in bundle config. Please configure another provider using `bundle config set gem.ci SERVICE` (where SERVICE is one of github/gitlab/circle) or unset configuration using `bundle config unset gem.ci`."
- exit 1
- end
end
def validate_rust_builder_rubygems_version
if Gem::Version.new(rust_builder_required_rubygems_version) > Gem.rubygems_version
Bundler.ui.error "Your RubyGems version (#{Gem.rubygems_version}) is too old to build Rust extension. Please update your RubyGems using `gem update --system` or any other way and try again."