[rubygems/rubygems] minor language tweaks, small code refactor

https://github.com/rubygems/rubygems/commit/84e9f3711c
This commit is contained in:
Andre Arko 2020-03-07 19:41:42 -08:00 коммит произвёл Hiroshi SHIBATA
Родитель 6f9faa66fa
Коммит 3a2016b994
1 изменённых файлов: 19 добавлений и 26 удалений

Просмотреть файл

@ -107,23 +107,16 @@ module Bundler
end end
end end
if ci_template = ask_and_set_ci config[:ci] = ask_and_set_ci
config[:ci] = ci_template case config[:ci]
when "github"
case ci_template templates.merge!(".github/workflows/main.yml.tt" => ".github/workflows/main.yml")
when "github" when "travis"
templates.merge!(".github/workflows/main.yml.tt" => ".github/workflows/main.yml") templates.merge!("travis.yml.tt" => ".travis.yml")
config[:ci] = "github" when "gitlab"
when "travis" templates.merge!(".gitlab-ci.yml.tt" => ".gitlab-ci.yml")
templates.merge!("travis.yml.tt" => ".travis.yml") when "circle"
config[:ci] = "travis" templates.merge!(".circleci/config.yml.tt" => ".circleci/config.yml")
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
end end
if ask_and_set(:mit, "Do you want to license your code permissively under the MIT license?", 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"] ci_template = options[:ci] || Bundler.settings["gem.ci"]
if ci_template.nil? if ci_template.nil?
Bundler.ui.confirm "Do you want to add Continuous Integration to your gem? " \ Bundler.ui.confirm "Do you want to set up automated testing for your gem? " \
"Adding a CI service to your project helps ensure your project is well tested " \ "Continuous integration services make it easy to see if pull requests have passing tests " \
"before shipping your gem to users. Bundler recommends several different services for testing "\ "before you merge them. Bundler supports these services:"\
"your code. For more information about each service, see:\n" \ "* Circle CI: https://circleci.com/\n" \
"* Travis CI: https://travis-ci.org/\n" \ "* Github Actions: https://github.com/features/actions\n" \
"* Github Actions: https://github.com/features/actions\n" \ "* Gitlab CI: https://docs.gitlab.com/ee/ci/\n" \
"* Circle CI: https://circleci.com/\n" \ "* Travis CI: https://travis-ci.org/\n" \
"* Gitlab CI: https://docs.gitlab.com/ee/ci/\n\n" "\n"
result = Bundler.ui.ask "Type 'github', 'travis', 'gitlab' or 'circle' to generate the CI configuration now and " \ result = Bundler.ui.ask "Enter a service name to generate a CI configuration now and " \
"in the future. github/travis/gitlab/circle/(none):" "in the future. github/travis/gitlab/circle/(none):"
if result =~ /github|travis|gitlab|circle/ if result =~ /github|travis|gitlab|circle/
ci_template = result ci_template = result