diff options
-rw-r--r-- | lib/rubygems.rb | 3 | ||||
-rw-r--r-- | lib/rubygems/commands/cert_command.rb | 1 | ||||
-rw-r--r-- | lib/rubygems/commands/query_command.rb | 14 | ||||
-rw-r--r-- | lib/rubygems/config_file.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/dependency_resolver.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/remote_fetcher.rb | 11 | ||||
-rw-r--r-- | lib/rubygems/security.rb | 22 | ||||
-rw-r--r-- | lib/rubygems/security/policy.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/spec_fetcher.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/test_utilities.rb | 2 |
10 files changed, 51 insertions, 18 deletions
@@ -895,7 +895,8 @@ module Gem def self.win_platform? if @@win_platform.nil? then - @@win_platform = !!WIN_PATTERNS.find { |r| RUBY_PLATFORM =~ r } end @@win_platform @@ -1,5 +1,6 @@ require 'rubygems/command' require 'rubygems/security' class Gem::Commands::CertCommand < Gem::Command @@ -192,9 +192,13 @@ class Gem::Commands::QueryCommand < Gem::Command end end - def entry_details entry, spec, specs, platforms return unless options[:details] entry << "\n" spec_platforms entry, platforms @@ -228,19 +232,15 @@ class Gem::Commands::QueryCommand < Gem::Command def make_entry entry_tuples, platforms detail_tuple = entry_tuples.first - name_tuple, latest_spec = detail_tuple - - latest_spec = latest_spec.fetch_spec name_tuple unless - Gem::Specification === latest_spec name_tuples, specs = entry_tuples.flatten.partition do |item| Gem::NameTuple === item end - entry = [latest_spec.name] entry_versions entry, name_tuples, platforms - entry_details entry, latest_spec, specs, platforms entry.join end @@ -317,14 +317,14 @@ if you believe they were disclosed to a third party. begin content = YAML.load(File.read(filename)) unless content.kind_of? Hash - warn "Failed to load #{config_file_name} because it doesn't contain valid YAML hash" return {} end return content rescue ArgumentError - warn "Failed to load #{config_file_name}" rescue Errno::EACCES - warn "Failed to load #{config_file_name} due to permissions problem." end {} @@ -406,6 +406,8 @@ module Gem source = Gem.sources.first end source.download full_spec, path end @@ -127,8 +127,6 @@ class Gem::RemoteFetcher # always replaced. def download(spec, source_uri, install_dir = Gem.dir) - Gem.ensure_gem_subdirectories(install_dir) rescue nil - cache_dir = if Dir.pwd == install_dir then # see fetch_command install_dir @@ -403,7 +401,8 @@ class Gem::RemoteFetcher connection.start unless connection.started? connection - rescue OpenSSL::SSL::SSLError, Errno::EHOSTDOWN => e raise FetchError.new(e.message, uri) end @@ -424,6 +423,12 @@ class Gem::RemoteFetcher add_rubygems_trusted_certs(store) end connection.cert_store = store end def add_rubygems_trusted_certs(store) @@ -5,9 +5,29 @@ #++ require 'rubygems/exceptions' -require 'openssl' require 'fileutils' ## # = Signing gems # @@ -20,6 +20,8 @@ class Gem::Security::Policy # options. def initialize name, policy = {}, opt = {} @name = name @opt = opt @@ -228,10 +228,14 @@ class Gem::SpecFetcher end end def upgrade_http_source source uri = source.uri - return source unless uri.scheme.downcase == 'http' https_uri = uri.dup https_uri.scheme = 'https' @@ -121,8 +121,6 @@ class Gem::FakeFetcher path = File.join path, name - Gem.ensure_gem_subdirectories install_dir - if source_uri =~ /^http/ then File.open(path, "wb") do |f| f.write fetch_path(File.join(source_uri, "gems", name)) |