1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Move already configured --ci hint to before CI file creation

https://github.com/rubygems/rubygems/commit/2af2abe5fd
This commit is contained in:
Frank Lam 2020-06-02 08:59:53 +08:00 committed by Hiroshi SHIBATA
parent 091daaa715
commit 0ba2f3e8a9
Notes: git 2020-06-18 19:15:10 +09:00
2 changed files with 6 additions and 11 deletions

View file

@ -193,12 +193,6 @@ module Bundler
"so -t is not needed if you want to continue using it. " \
"This setting can be changed anytime with `bundle config gem.test`."
end
if options[:ci] == Bundler.settings["gem.ci"]
Bundler.ui.info "Bundler is configured to generate CI files for #{Bundler.settings["gem.ci"]}, "\
"so --ci is not needed if you want to continue using it. " \
"This setting can be changed anytime with `bundle config gem.ci`."
end
rescue Errno::EEXIST => e
raise GenericSystemCallError.new(e, "There was a conflict while creating the new gem.")
end
@ -288,6 +282,10 @@ module Bundler
Bundler.settings.set_global("gem.ci", ci_template)
end
if options[:ci] == Bundler.settings["gem.ci"]
Bundler.ui.info "#{options[:ci]} is already configured, ignoring --ci flag."
end
ci_template
end

View file

@ -749,11 +749,8 @@ RSpec.describe "bundle gem" do
expect(bundled_app("#{gem_name}/.github/workflows/main.yml")).to exist
end
it "hints that --ci is not needed" do
hint = "Bundler is configured to generate CI files for github, "\
"so --ci is not needed if you want to continue using it. " \
"This setting can be changed anytime with `bundle config gem.ci`."
expect(out).to match(hint)
it "hints that --ci is already configured" do
expect(out).to match("github is already configured, ignoring --ci flag.")
end
end