diff options
author | Eric Mueller <nevinera@gmail.com> | 2023-12-01 23:23:18 -0500 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-12-06 20:05:25 +0000 |
commit | 9336bbb0b268cb655e6c07ad2a83b9a28cb98911 (patch) | |
tree | fa37aafea011a3fef177c8dd8c91c62709d104ce /lib | |
parent | 6fd3b358ff1e1745036286be7007cd0d6ebdcdd7 (diff) | |
download | ruby-9336bbb0b268cb655e6c07ad2a83b9a28cb98911.tar.gz |
[rubygems/rubygems] Bundler::Fetcher uses Bundler::CIDetector
Additionally, the result is memoized, as it's used twice in a row.
This change does result in a net behavioral diff, as the list of ENVs
being checked has been updated (now includes buildkite, taskcluster,
cirrus, dsari, and drops buildbox and snap)
https://github.com/rubygems/rubygems/commit/3fb445a5a1
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/fetcher.rb | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb index dd91b7ceb4..27d931da4d 100644 --- a/lib/bundler/fetcher.rb +++ b/lib/bundler/fetcher.rb @@ -95,6 +95,7 @@ module Bundler self.max_retries = Bundler.settings[:retry] # How many retries for the API call def initialize(remote) + @cis = nil @remote = remote Socket.do_not_reverse_lookup = true @@ -242,20 +243,7 @@ module Bundler end def cis - env_cis = { - "TRAVIS" => "travis", - "CIRCLECI" => "circle", - "SEMAPHORE" => "semaphore", - "JENKINS_URL" => "jenkins", - "BUILDBOX" => "buildbox", - "GO_SERVER_URL" => "go", - "SNAP_CI" => "snap", - "GITLAB_CI" => "gitlab", - "GITHUB_ACTIONS" => "github", - "CI_NAME" => ENV["CI_NAME"], - "CI" => "ci", - } - env_cis.find_all {|env, _| ENV[env] }.map {|_, ci| ci } + @cis ||= Bundler::CIDetector.ci_strings end def connection |