summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/cli/doctor/ssl.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/bundler/cli/doctor/ssl.rb b/lib/bundler/cli/doctor/ssl.rb
index 6742991122..f0d8a9b986 100644
--- a/lib/bundler/cli/doctor/ssl.rb
+++ b/lib/bundler/cli/doctor/ssl.rb
@@ -1,5 +1,6 @@
# frozen_string_literal: true
+require "rubygems/remote_fetcher"
require "uri"
module Bundler
@@ -15,6 +16,7 @@ module Bundler
output_ssl_environment
bundler_success = bundler_connection_successful?
+ rubygem_success = rubygem_connection_successful?
end
private
@@ -79,6 +81,17 @@ module Bundler
false
end
+ def rubygem_connection_successful?
+ Gem::RemoteFetcher.fetcher.fetch_path(uri)
+ Bundler.ui.info("RubyGems: success")
+
+ true
+ rescue StandardError => error
+ Bundler.ui.warn("RubyGems: failed (#{Explanation.explain_bundler_or_rubygems_error(error)})")
+
+ false
+ end
+
module Explanation
extend self