diff --git a/ChangeLog b/ChangeLog index 53084888c9..6abc562291 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Apr 6 15:00:27 2016 SHIBATA Hiroshi + + * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.6.3. + Please see entries of 2.6.3 on + https://github.com/rubygems/rubygems/blob/master/History.txt + Wed Apr 6 14:13:28 2016 Nobuyoshi Nakada * configure.in (rb_cv_lgamma_r_m0): check if lgamma_r(-0.0) diff --git a/lib/rubygems.rb b/lib/rubygems.rb index 6b2016fd9b..78d612af63 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -10,7 +10,7 @@ require 'rbconfig' require 'thread' module Gem - VERSION = '2.6.2' + VERSION = '2.6.3' end # Must be first since it unloads the prelude from 1.9.2 @@ -374,8 +374,9 @@ module Gem when Array unless Gem::Deprecate.skip warn <<-eowarn -Array values in the parameter are deprecated. Please use a String or nil. -An Array was passed in from #{caller[3]} +Array values in the parameter to `Gem.paths=` are deprecated. +Please use a String or nil. +An Array (#{env.inspect}) was passed in from #{caller[3]} eowarn end target[k] = v.join File::PATH_SEPARATOR diff --git a/lib/rubygems/basic_specification.rb b/lib/rubygems/basic_specification.rb index 86f2248b52..5aed17437e 100644 --- a/lib/rubygems/basic_specification.rb +++ b/lib/rubygems/basic_specification.rb @@ -306,6 +306,8 @@ class Gem::BasicSpecification raise NotImplementedError end + def this; self; end + private def have_extensions?; !extensions.empty?; end @@ -323,5 +325,4 @@ class Gem::BasicSpecification false end end - end diff --git a/lib/rubygems/commands/install_command.rb b/lib/rubygems/commands/install_command.rb index 4dd2f943c1..3a7d50517f 100644 --- a/lib/rubygems/commands/install_command.rb +++ b/lib/rubygems/commands/install_command.rb @@ -36,52 +36,6 @@ class Gem::Commands::InstallCommand < Gem::Command add_version_option add_prerelease_option "to be installed. (Only for listed gems)" - add_option(:"Install/Update", '-g', '--file [FILE]', - 'Read from a gem dependencies API file and', - 'install the listed gems') do |v,o| - v = Gem::GEM_DEP_FILES.find do |file| - File.exist? file - end unless v - - unless v then - message = v ? v : "(tried #{Gem::GEM_DEP_FILES.join ', '})" - - raise OptionParser::InvalidArgument, - "cannot find gem dependencies file #{message}" - end - - o[:gemdeps] = v - end - - add_option(:"Install/Update", '--without GROUPS', Array, - 'Omit the named groups (comma separated)', - 'when installing from a gem dependencies', - 'file') do |v,o| - o[:without_groups].concat v.map { |without| without.intern } - end - - add_option(:"Install/Update", '--default', - 'Add the gem\'s full specification to', - 'specifications/default and extract only its bin') do |v,o| - o[:install_as_default] = v - end - - add_option(:"Install/Update", '--explain', - 'Rather than install the gems, indicate which would', - 'be installed') do |v,o| - o[:explain] = v - end - - add_option(:"Install/Update", '--[no-]lock', - 'Create a lock file (when used with -g/--file)') do |v,o| - o[:lock] = v - end - - add_option(:"Install/Update", '--[no-]suggestions', - 'Suggest alternates when gems are not found') do |v,o| - o[:suggest_alternate] = v - end - @installed_specs = [] end diff --git a/lib/rubygems/commands/owner_command.rb b/lib/rubygems/commands/owner_command.rb index e507c988d6..4b99434e87 100644 --- a/lib/rubygems/commands/owner_command.rb +++ b/lib/rubygems/commands/owner_command.rb @@ -66,7 +66,7 @@ permission to. say "Owners for gem: #{name}" owners.each do |owner| - say "- #{owner['email']}" + say "- #{owner['email'] || owner['handle'] || owner['id']}" end end end @@ -97,4 +97,3 @@ permission to. end end - diff --git a/lib/rubygems/commands/pristine_command.rb b/lib/rubygems/commands/pristine_command.rb index a5a348dc72..6cab572b86 100644 --- a/lib/rubygems/commands/pristine_command.rb +++ b/lib/rubygems/commands/pristine_command.rb @@ -92,8 +92,8 @@ extensions will be restored. spec.extensions and not spec.extensions.empty? end else - get_all_gem_names.map do |gem_name| - Gem::Specification.find_all_by_name gem_name, options[:version] + get_all_gem_names.sort.map do |gem_name| + Gem::Specification.find_all_by_name(gem_name, options[:version]).reverse end.flatten end diff --git a/lib/rubygems/commands/query_command.rb b/lib/rubygems/commands/query_command.rb index d6196b44ed..fb2d6a53c8 100644 --- a/lib/rubygems/commands/query_command.rb +++ b/lib/rubygems/commands/query_command.rb @@ -247,7 +247,7 @@ is too hard to use. spec_summary entry, spec end - def entry_versions entry, name_tuples, platforms + def entry_versions entry, name_tuples, platforms, specs return unless options[:versions] list = @@ -256,7 +256,16 @@ is too hard to use. else platforms.sort.reverse.map do |version, pls| if pls == [Gem::Platform::RUBY] then - version + if options[:domain] == :remote || specs.all? { |spec| spec.is_a? Gem::Source } + version + else + spec = specs.select { |spec| spec.version == version } + if spec.first.default_gem? + "default: #{version}" + else + version + end + end else ruby = pls.delete Gem::Platform::RUBY platform_list = [ruby, *pls.sort].compact @@ -277,7 +286,7 @@ is too hard to use. entry = [name_tuples.first.name] - entry_versions entry, name_tuples, platforms + entry_versions entry, name_tuples, platforms, specs entry_details entry, detail_tuple, specs, platforms entry.join diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb index 99093a1338..aa56ab5ec4 100755 --- a/lib/rubygems/core_ext/kernel_require.rb +++ b/lib/rubygems/core_ext/kernel_require.rb @@ -104,7 +104,7 @@ module Kernel # Ok, now find a gem that has no conflicts, starting # at the highest version. - valid = found_specs.reject { |s| s.has_conflicts? }.last + valid = found_specs.reject { |s| s.has_conflicts? }.first unless valid then le = Gem::LoadError.new "unable to find a version of '#{names.first}' to activate" diff --git a/lib/rubygems/dependency.rb b/lib/rubygems/dependency.rb index b7aea4692b..ecfd0b7909 100644 --- a/lib/rubygems/dependency.rb +++ b/lib/rubygems/dependency.rb @@ -286,9 +286,7 @@ class Gem::Dependency } end - # `stubs_for` returns oldest first, but `matching_specs` is supposed to - # return newest first, so just reverse the list - matches.reverse + matches end ## @@ -307,18 +305,10 @@ class Gem::Dependency specs = Gem::Specification.stubs_for name if specs.empty? - total = Gem::Specification.stubs.size - msg = "Could not find '#{name}' (#{requirement}) among #{total} total gem(s)\n".dup + raise Gem::MissingSpecError.new name, requirement else - specs = specs.map(&:full_name) - msg = "Could not find '#{name}' (#{requirement}) - did find: [#{specs.join ','}]\n".dup + raise Gem::MissingSpecVersionError.new name, requirement, specs end - msg << "Checked in 'GEM_PATH=#{Gem.path.join(File::PATH_SEPARATOR)}', execute `gem env` for more information" - - error = Gem::LoadError.new(msg) - error.name = self.name - error.requirement = self.requirement - raise error end # TODO: any other resolver validations should go here diff --git a/lib/rubygems/errors.rb b/lib/rubygems/errors.rb index 8304647546..f607d14938 100644 --- a/lib/rubygems/errors.rb +++ b/lib/rubygems/errors.rb @@ -20,6 +20,49 @@ module Gem attr_accessor :requirement end + ## + # Raised when trying to activate a gem, and that gem does not exist on the + # system. Instead of rescuing from this class, make sure to rescue from the + # superclass Gem::LoadError to catch all types of load errors. + class MissingSpecError < Gem::LoadError + def initialize name, requirement + @name = name + @requirement = requirement + end + + def message # :nodoc: + build_message + + "Checked in 'GEM_PATH=#{Gem.path.join(File::PATH_SEPARATOR)}', execute `gem env` for more information" + end + + private + + def build_message + total = Gem::Specification.stubs.size + "Could not find '#{name}' (#{requirement}) among #{total} total gem(s)\n" + end + end + + ## + # Raised when trying to activate a gem, and the gem exists on the system, but + # not the requested version. Instead of rescuing from this class, make sure to + # rescue from the superclass Gem::LoadError to catch all types of load errors. + class MissingSpecVersionError < MissingSpecError + attr_reader :specs + + def initialize name, requirement, specs + super(name, requirement) + @specs = specs + end + + private + + def build_message + names = specs.map(&:full_name) + "Could not find '#{name}' (#{requirement}) - did find: [#{names.join ','}]\n" + end + end + # Raised when there are conflicting gem specs loaded class ConflictError < LoadError diff --git a/lib/rubygems/install_update_options.rb b/lib/rubygems/install_update_options.rb index b2ab419800..5559c94370 100644 --- a/lib/rubygems/install_update_options.rb +++ b/lib/rubygems/install_update_options.rb @@ -180,6 +180,52 @@ module Gem::InstallUpdateOptions options[:post_install_message] = value end + add_option(:"Install/Update", '-g', '--file [FILE]', + 'Read from a gem dependencies API file and', + 'install the listed gems') do |v,o| + v = Gem::GEM_DEP_FILES.find do |file| + File.exist? file + end unless v + + unless v then + message = v ? v : "(tried #{Gem::GEM_DEP_FILES.join ', '})" + + raise OptionParser::InvalidArgument, + "cannot find gem dependencies file #{message}" + end + + options[:gemdeps] = v + end + + add_option(:"Install/Update", '--without GROUPS', Array, + 'Omit the named groups (comma separated)', + 'when installing from a gem dependencies', + 'file') do |v,o| + options[:without_groups].concat v.map { |without| without.intern } + end + + add_option(:"Install/Update", '--default', + 'Add the gem\'s full specification to', + 'specifications/default and extract only its bin') do |v,o| + options[:install_as_default] = v + end + + add_option(:"Install/Update", '--explain', + 'Rather than install the gems, indicate which would', + 'be installed') do |v,o| + options[:explain] = v + end + + add_option(:"Install/Update", '--[no-]lock', + 'Create a lock file (when used with -g/--file)') do |v,o| + options[:lock] = v + end + + add_option(:"Install/Update", '--[no-]suggestions', + 'Suggest alternates when gems are not found') do |v,o| + options[:suggest_alternate] = v + end + end ## diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb index a88d393336..1813c9a27d 100644 --- a/lib/rubygems/installer.rb +++ b/lib/rubygems/installer.rb @@ -231,7 +231,7 @@ class Gem::Installer question = "#{spec.name}'s executable \"#{filename}\" conflicts with ".dup if ruby_executable then - question << existing + question << (existing || 'an unknown executable') return if ask_yes_no "#{question}\nOverwrite the executable?", false diff --git a/lib/rubygems/request.rb b/lib/rubygems/request.rb index 7f2cb30e98..9de04a0c4b 100644 --- a/lib/rubygems/request.rb +++ b/lib/rubygems/request.rb @@ -40,7 +40,7 @@ class Gem::Request def cert_files; @connection_pool.cert_files; end def self.get_cert_files - pattern = File.expand_path("./ssl_certs/*.pem", File.dirname(__FILE__)) + pattern = File.expand_path("./ssl_certs/*/*.pem", File.dirname(__FILE__)) Dir.glob(pattern) end diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index 8ff6299a41..b3066f2003 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -849,7 +849,7 @@ class Gem::Specification < Gem::BasicSpecification pattern = "#{name}-*.gemspec" stubs = default_stubs(pattern) + installed_stubs(dirs, pattern) stubs = uniq_by(stubs) { |stub| stub.full_name }.group_by(&:name) - stubs.each_value { |v| sort_by!(v) { |i| i.version } } + stubs.each_value { |v| _resort!(v) } @@stubs_by_name.merge! stubs @@stubs_by_name[name] ||= EMPTY @@ -1074,7 +1074,7 @@ class Gem::Specification < Gem::BasicSpecification def self.find_in_unresolved_tree path specs = unresolved_deps.values.map { |dep| dep.to_specs }.flatten - specs.reverse_each do |spec| + specs.each do |spec| spec.traverse do |from_spec, dep, to_spec, trail| if to_spec.has_conflicts? || to_spec.conficts_when_loaded_with?(trail) :next @@ -2613,7 +2613,7 @@ class Gem::Specification < Gem::BasicSpecification begin dependencies.each do |dep| next unless dep.runtime? - dep.to_specs.reverse_each do |dep_spec| + dep.to_specs.each do |dep_spec| next if visited.has_key?(dep_spec) visited[dep_spec] = true trail.push(dep_spec) diff --git a/lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem b/lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem deleted file mode 100644 index 6fbdf52b17..0000000000 --- a/lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem +++ /dev/null @@ -1,32 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFdDCCBFygAwIBAgIQJ2buVutJ846r13Ci/ITeIjANBgkqhkiG9w0BAQwFADBv -MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk -ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF -eHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFow -gYUxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO -BgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMSswKQYD -VQQDEyJDT01PRE8gUlNBIENlcnRpZmljYXRpb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h0dHA6 -Ly9vY3NwLnVzZXJ0cnVzdC5jb20wDQYJKoZIhvcNAQEMBQADggEBAGS/g/FfmoXQ -zbihKVcN6Fr30ek+8nYEbvFScLsePP9NDXRqzIGCJdPDoCpdTPW6i6FtxFQJdcfj -Jw5dhHk3QBN39bSsHNA7qxcS1u80GH4r6XnTq1dFDK8o+tDb5VCViLvfhVdpfZLY -Uspzgb8c8+a4bmYRBbMelC1/kZWSWfFMzqORcUx8Rww7Cxn2obFshj5cqsQugsv5 -B5a6SE2Q8pTIqXOi6wZ7I53eovNNVZ96YUWYGGjHXkBrI/V5eu+MtWuLt29G9Hvx -PUsE2JOAWVrgQSQdso8VYFhH2+9uRv0V9dlfmrPb2LjkQLPNlzmuhbsdjrzch5vR -pu/xO28QOG8= ------END CERTIFICATE----- diff --git a/lib/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem b/lib/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem deleted file mode 100644 index 87676acf5f..0000000000 --- a/lib/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG -A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz -cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 -MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV -BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt -YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN -ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE -BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is -I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G -CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do -lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc -AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k ------END CERTIFICATE----- diff --git a/lib/rubygems/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem b/lib/rubygems/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem deleted file mode 100644 index 4b8939ccba..0000000000 --- a/lib/rubygems/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC -VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u -ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc -KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u -ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1 -MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE -ChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j -b3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF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ziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd -2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI= ------END CERTIFICATE----- diff --git a/lib/rubygems/ssl_certs/GeoTrustGlobalCA.pem b/lib/rubygems/ssl_certs/GeoTrustGlobalCA.pem deleted file mode 100644 index bcb2529761..0000000000 --- a/lib/rubygems/ssl_certs/GeoTrustGlobalCA.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT -MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i -YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG -EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg -R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9 -9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq -fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv -iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU -1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ -bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW -MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA -ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l -uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn -Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS -tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF -PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un -hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV -5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== ------END CERTIFICATE----- diff --git a/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRoot.pem b/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRoot.pem new file mode 100644 index 0000000000..471f3c553b --- /dev/null +++ b/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRoot.pem @@ -0,0 +1,18 @@ +-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx +GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds +b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV +BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD +VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa +DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc +THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb +Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP +c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX +gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF +AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj +Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG +j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH +hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC +X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem b/lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem similarity index 100% rename from lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem rename to lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem diff --git a/lib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem b/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot-2048.pem similarity index 100% rename from lib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem rename to lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot-2048.pem diff --git a/lib/rubygems/stub_specification.rb b/lib/rubygems/stub_specification.rb index 61df5a2262..1c56a102c5 100644 --- a/lib/rubygems/stub_specification.rb +++ b/lib/rubygems/stub_specification.rb @@ -89,8 +89,6 @@ class Gem::StubSpecification < Gem::BasicSpecification end end - def this; self; end - def default_gem? @default_gem end @@ -212,4 +210,3 @@ class Gem::StubSpecification < Gem::BasicSpecification end end - diff --git a/test/rubygems/test_bundled_ca.rb b/test/rubygems/test_bundled_ca.rb index f3da13b1b5..5ce2850518 100644 --- a/test/rubygems/test_bundled_ca.rb +++ b/test/rubygems/test_bundled_ca.rb @@ -17,7 +17,7 @@ if ENV["TRAVIS"] || ENV["TEST_SSL"] store = OpenSSL::X509::Store.new ssl_cert_glob = - File.expand_path '../../../lib/rubygems/ssl_certs/*.pem', THIS_FILE + File.expand_path '../../../lib/rubygems/ssl_certs/*/*.pem', THIS_FILE Dir[ssl_cert_glob].each do |ssl_cert| store.add_file ssl_cert @@ -55,5 +55,9 @@ if ENV["TRAVIS"] || ENV["TEST_SSL"] assert_https('rubygems.global.ssl.fastly.net') end + def test_accessing_new_index + assert_https('fastly.rubygems.org') + end + end end diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index 931c9e498d..81b2c01519 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -973,6 +973,19 @@ class TestGem < Gem::TestCase assert Gem.try_activate('b'), 'try_activate should still return true' end + def test_spec_order_is_consistent + b1 = util_spec 'b', '1.0' + b2 = util_spec 'b', '2.0' + b3 = util_spec 'b', '3.0' + + install_specs b1, b2, b3 + + specs1 = Gem::Specification.stubs.find_all { |s| s.name == 'b' } + Gem::Specification.reset + specs2 = Gem::Specification.stubs_for('b') + assert_equal specs1.map(&:version), specs2.map(&:version) + end + def test_self_try_activate_missing_dep b = util_spec 'b', '1.0' a = util_spec 'a', '1.0', 'b' => '>= 1.0' @@ -986,7 +999,7 @@ class TestGem < Gem::TestCase io.puts '# a_file.rb' end - e = assert_raises Gem::LoadError do + e = assert_raises Gem::MissingSpecError do Gem.try_activate 'a_file' end @@ -1006,7 +1019,7 @@ class TestGem < Gem::TestCase io.puts '# a_file.rb' end - e = assert_raises Gem::LoadError do + e = assert_raises Gem::MissingSpecError do Gem.try_activate 'a_file' end @@ -1070,7 +1083,7 @@ class TestGem < Gem::TestCase 'GEM_PATH' => [Gem.paths.home, 'foo'] } end assert_equal [Gem.paths.home, 'foo'], Gem.paths.path - assert_match(/Array values in the parameter are deprecated. Please use a String or nil/, stderr) + assert_match(/Array values in the parameter to `Gem.paths=` are deprecated.\nPlease use a String or nil/m, stderr) assert_equal '', stdout end diff --git a/test/rubygems/test_gem_commands_environment_command.rb b/test/rubygems/test_gem_commands_environment_command.rb index 7ffcbb5454..040e5c4c39 100644 --- a/test/rubygems/test_gem_commands_environment_command.rb +++ b/test/rubygems/test_gem_commands_environment_command.rb @@ -23,7 +23,7 @@ class TestGemCommandsEnvironmentCommand < Gem::TestCase end assert_match %r|RUBYGEMS VERSION: (\d\.)+\d|, @ui.output - assert_match %r|RUBY VERSION: \d\.\d\.\d \(.*\) \[.*\]|, @ui.output + assert_match %r|RUBY VERSION: \d+\.\d+\.\d+ \(.*\) \[.*\]|, @ui.output assert_match %r|INSTALLATION DIRECTORY: #{Regexp.escape @gemhome}|, @ui.output assert_match %r|RUBYGEMS PREFIX: |, @ui.output diff --git a/test/rubygems/test_gem_commands_owner_command.rb b/test/rubygems/test_gem_commands_owner_command.rb index 7217f5cff0..44652c1093 100644 --- a/test/rubygems/test_gem_commands_owner_command.rb +++ b/test/rubygems/test_gem_commands_owner_command.rb @@ -19,7 +19,12 @@ class TestGemCommandsOwnerCommand < Gem::TestCase response = <1" - assert_raises Gem::LoadError do + assert_raises Gem::MissingSpecError do Gem::Specification.find_by_name "monkeys" end end @@ -3387,7 +3398,7 @@ end assert Gem::Specification.find_by_name "b" - assert_raises Gem::LoadError do + assert_raises Gem::MissingSpecVersionError do Gem::Specification.find_by_name "b", "1" end diff --git a/test/rubygems/test_kernel.rb b/test/rubygems/test_kernel.rb index e6e11b8efb..b565c62f4a 100644 --- a/test/rubygems/test_kernel.rb +++ b/test/rubygems/test_kernel.rb @@ -66,7 +66,7 @@ class TestKernel < Gem::TestCase def test_gem_env_req ENV["GEM_REQUIREMENT_A"] = '~> 2.0' - assert_raises(Gem::LoadError) { gem('a', '= 1') } + assert_raises(Gem::MissingSpecVersionError) { gem('a', '= 1') } assert gem('a', '> 1') assert_equal @a2, Gem.loaded_specs['a'] end