diff options
-rw-r--r-- | lib/rubygems/commands/update_command.rb | 24 | ||||
-rw-r--r-- | lib/rubygems/defaults.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/indexer.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/installer.rb | 7 | ||||
-rw-r--r-- | lib/rubygems/package.rb | 9 | ||||
-rw-r--r-- | lib/rubygems/platform.rb | 10 | ||||
-rw-r--r-- | lib/rubygems/remote_fetcher.rb | 11 | ||||
-rw-r--r-- | lib/rubygems/security/trust_dir.rb | 1 | ||||
-rw-r--r-- | lib/rubygems/test_utilities.rb | 2 |
9 files changed, 37 insertions, 31 deletions
@@ -81,7 +81,7 @@ command to remove old versions. def check_oldest_rubygems(version) # :nodoc: if oldest_supported_version > version - alert_error "rubygems #{version} is not supported. The oldest supported version is #{oldest_supported_version}" terminate_interaction 1 end end @@ -327,8 +327,26 @@ command to remove old versions. private def oldest_supported_version - # for Ruby 2.3 - @oldest_supported_version ||= Gem::Version.new("2.5.2") end end @@ -198,7 +198,7 @@ module Gem def self.default_bindir if defined? RUBY_FRAMEWORK_VERSION # mac framework support - '/usr/bin' else # generic install RbConfig::CONFIG['bindir'] end @@ -136,7 +136,7 @@ class Gem::Indexer say "Generating #{name} index" Gem.time "Generated #{name} index" do - open(file, 'wb') do |io| specs = index.map do |*spec| # We have to splat here because latest_specs is an array, while the # others are hashes. @@ -484,8 +484,11 @@ class Gem::Installer bin_path = File.join gem_dir, spec.bindir, filename unless File.exist? bin_path - # TODO change this to a more useful warning - warn "`#{bin_path}` does not exist, maybe `gem pristine #{spec.name}` will fix it?" next end @@ -252,14 +252,7 @@ class Gem::Package stat = File.lstat file if stat.symlink? - target_path = File.readlink(file) - - unless target_path.start_with? '.' - relative_dir = File.dirname(file).sub("#{Dir.pwd}/", '') - target_path = File.join(relative_dir, target_path) - end - - tar.add_symlink file, target_path, stat.mode end next unless stat.file? @@ -66,7 +66,7 @@ class Gem::Platform when String then arch = arch.split '-' - if arch.length > 2 and arch.last !~ /\d+(\.\d+)?$/ # reassemble x86-linux-{libc} extra = arch.pop arch.last << "-#{extra}" end @@ -146,8 +146,7 @@ class Gem::Platform ## # Does +other+ match this platform? Two platforms match if they have the # same CPU, or either has a CPU of 'universal', they have the same OS, and - # they have the same version, or either has no version (except for 'linux' - # where the version is the libc name, with no version standing for 'gnu') # # Additionally, the platform will match if the local CPU is 'arm' and the # other CPU starts with "arm" (for generic ARM family support). @@ -163,10 +162,7 @@ class Gem::Platform @os == other.os and # version - ( - (@os != 'linux' and (@version.nil? or other.version.nil?)) or - @version == other.version - ) end ## @@ -51,6 +51,7 @@ class Gem::RemoteFetcher class UnknownHostError < FetchError end @fetcher = nil @@ -262,15 +263,9 @@ class Gem::RemoteFetcher end data - rescue Timeout::Error - raise UnknownHostError.new('timed out', uri) - rescue IOError, SocketError, SystemCallError, *(OpenSSL::SSL::SSLError if Gem::HAVE_OPENSSL) => e - if e.message =~ /getaddrinfo/ - raise UnknownHostError.new('no such name', uri) - else - raise FetchError.new("#{e.class}: #{e}", uri) - end end def fetch_s3(uri, mtime = nil, head = false) @@ -104,6 +104,7 @@ class Gem::Security::TrustDir # permissions. def verify if File.exist? @dir raise Gem::Security::Exception, "trust directory #{@dir} is not a directory" unless @@ -76,7 +76,7 @@ class Gem::FakeFetcher def cache_update_path(uri, path = nil, update = true) if data = fetch_path(uri) - open(path, 'wb') {|io| io.write data } if path and update data else Gem.read_binary(path) if path |