aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/rubygems/update_suggestion.rb15
-rw-r--r--test/rubygems/test_gem_update_suggestion.rb2
2 files changed, 2 insertions, 15 deletions
diff --git a/lib/rubygems/update_suggestion.rb b/lib/rubygems/update_suggestion.rb
index af7067f9b3..6f3ec5f493 100644
--- a/lib/rubygems/update_suggestion.rb
+++ b/lib/rubygems/update_suggestion.rb
@@ -4,15 +4,6 @@
# Mixin methods for Gem::Command to promote available RubyGems update
module Gem::UpdateSuggestion
- # list taken from https://github.com/watson/ci-info/blob/7a3c30d/index.js#L56-L66
- CI_ENV_VARS = [
- "CI", # Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari
- "CONTINUOUS_INTEGRATION", # Travis CI, Cirrus CI
- "BUILD_NUMBER", # Jenkins, TeamCity
- "CI_APP_ID", "CI_BUILD_ID", "CI_BUILD_NUMBER", # Applfow
- "RUN_ID" # TaskCluster, dsari
- ].freeze
-
ONE_WEEK = 7 * 24 * 60 * 60
##
@@ -39,7 +30,7 @@ Run `gem update --system #{Gem.latest_rubygems_version}` to update your installa
return false unless Gem.ui.tty?
return false if Gem.rubygems_version.prerelease?
return false if Gem.disable_system_update_message
- return false if ci?
+ return false if Gem::CIDetector.ci?
# check makes sense only when we can store timestamp of last try
# otherwise we will not be able to prevent "annoying" update message
@@ -62,8 +53,4 @@ Run `gem update --system #{Gem.latest_rubygems_version}` to update your installa
rescue StandardError # don't block install command on any problem
false
end
-
- def ci?
- CI_ENV_VARS.any? {|var| ENV.include?(var) }
- end
end
diff --git a/test/rubygems/test_gem_update_suggestion.rb b/test/rubygems/test_gem_update_suggestion.rb
index 8c254ec022..8cb8ee57ff 100644
--- a/test/rubygems/test_gem_update_suggestion.rb
+++ b/test/rubygems/test_gem_update_suggestion.rb
@@ -40,7 +40,7 @@ class TestUpdateSuggestion < Gem::TestCase
Gem.ui.stub :tty?, tty do
Gem.stub :rubygems_version, rubygems_version do
Gem.stub :latest_rubygems_version, latest_rubygems_version do
- cmd.stub :ci?, ci do
+ Gem::CIDetector.stub :ci?, ci do
yield
end
end