class Bundler::CLI::Gem

def ask_and_set_ci

def ask_and_set_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" \
      "* CircleCI:       https://circleci.com/\n" \
      "* GitHub Actions: https://github.com/features/actions\n" \
      "* GitLab CI:      https://docs.gitlab.com/ee/ci/\n" \
      "\n"
    Bundler.ui.info hint_text("ci")
    result = Bundler.ui.ask "Enter a CI service. github/gitlab/circle/(none):"
    if /github|gitlab|circle/.match?(result)
      ci_template = result
    else
      ci_template = false
    end
  end
  if Bundler.settings["gem.ci"].nil?
    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