summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2020-03-07 19:41:42 -0800
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-06-18 19:14:15 +0900
commit3a2016b99424170c1dba9d73a8b313f39f4864b6 (patch)
tree0a076435ee53368ecbad0d61ecd16ec4b70abbce /lib
parent6f9faa66fa31a38f151503ae7f8cc8e70323f92f (diff)
[rubygems/rubygems] minor language tweaks, small code refactor
https://github.com/rubygems/rubygems/commit/84e9f3711c
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3212
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/cli/gem.rb47
1 files changed, 20 insertions, 27 deletions
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb
index af310a534c..65a37dbb47 100644
--- a/lib/bundler/cli/gem.rb
+++ b/lib/bundler/cli/gem.rb
@@ -107,23 +107,16 @@ module Bundler
end
end
- if ci_template = ask_and_set_ci
- config[:ci] = ci_template
-
- case ci_template
- when "github"
- templates.merge!(".github/workflows/main.yml.tt" => ".github/workflows/main.yml")
- config[:ci] = "github"
- when "travis"
- templates.merge!("travis.yml.tt" => ".travis.yml")
- config[:ci] = "travis"
- when "gitlab"
- templates.merge!(".gitlab-ci.yml.tt" => ".gitlab-ci.yml")
- config[:ci] = "gitlab"
- when "circle"
- templates.merge!(".circleci/config.yml.tt" => ".circleci/config.yml")
- config[:ci] = "circleci"
- end
+ config[:ci] = ask_and_set_ci
+ case config[:ci]
+ when "github"
+ templates.merge!(".github/workflows/main.yml.tt" => ".github/workflows/main.yml")
+ when "travis"
+ templates.merge!("travis.yml.tt" => ".travis.yml")
+ when "gitlab"
+ templates.merge!(".gitlab-ci.yml.tt" => ".gitlab-ci.yml")
+ when "circle"
+ templates.merge!(".circleci/config.yml.tt" => ".circleci/config.yml")
end
if ask_and_set(:mit, "Do you want to license your code permissively under the MIT license?",
@@ -268,16 +261,16 @@ module Bundler
ci_template = options[:ci] || Bundler.settings["gem.ci"]
if ci_template.nil?
- Bundler.ui.confirm "Do you want to add Continuous Integration to your gem? " \
- "Adding a CI service to your project helps ensure your project is well tested " \
- "before shipping your gem to users. Bundler recommends several different services for testing "\
- "your code. For more information about each service, see:\n" \
- "* Travis CI: https://travis-ci.org/\n" \
- "* Github Actions: https://github.com/features/actions\n" \
- "* Circle CI: https://circleci.com/\n" \
- "* Gitlab CI: https://docs.gitlab.com/ee/ci/\n\n"
-
- result = Bundler.ui.ask "Type 'github', 'travis', 'gitlab' or 'circle' to generate the CI configuration now and " \
+ Bundler.ui.confirm "Do you want to set up automated testing for your gem? " \
+ "Continuous integration services make it easy to see if pull requests have passing tests " \
+ "before you merge them. Bundler supports these services:"\
+ "* Circle CI: https://circleci.com/\n" \
+ "* Github Actions: https://github.com/features/actions\n" \
+ "* Gitlab CI: https://docs.gitlab.com/ee/ci/\n" \
+ "* Travis CI: https://travis-ci.org/\n" \
+ "\n"
+
+ result = Bundler.ui.ask "Enter a service name to generate a CI configuration now and " \
"in the future. github/travis/gitlab/circle/(none):"
if result =~ /github|travis|gitlab|circle/
ci_template = result