diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-13 02:59:08 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-13 02:59:08 +0000 |
commit | 2ebea1180e09c57b5a1fc7764ef17dba600c486d (patch) | |
tree | a02c385811765bbf05a8ce06a3e237f299ba5ae9 | |
parent | 71f8a0d2aba6914c803525dd6a5a78f47da6ca4a (diff) |
* lib/rubygems: Update to RubyGems 2.0.14. [ruby-core:58300]
[Backport #9104]
the patch is provided by drbrain (Eric Hodel).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@43661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | lib/rubygems.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/dependency_installer.rb | 8 | ||||
-rw-r--r-- | lib/rubygems/specification.rb | 3 | ||||
-rw-r--r-- | lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem | 23 | ||||
-rw-r--r-- | test/rubygems/test_gem_dependency_installer.rb | 23 | ||||
-rw-r--r-- | test/rubygems/test_gem_remote_fetcher.rb | 90 | ||||
-rw-r--r-- | test/rubygems/test_gem_specification.rb | 22 | ||||
-rw-r--r-- | version.h | 6 |
10 files changed, 134 insertions, 53 deletions
@@ -1,3 +1,9 @@ +Wed Nov 13 11:57:01 2013 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org> + + * lib/rubygems: Update to RubyGems 2.0.14. [ruby-core:58300] + [Backport #9104] + the patch is provided by drbrain (Eric Hodel). + Tue Nov 12 23:41:43 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> * load.c (rb_feature_p): deal with default loadable suffixes. @@ -461,9 +461,9 @@ with all sufficient information, see the ChangeLog file. XML declaration is used for XML document encoding. * RubyGems - * Updated to 2.0.13. + * Updated to 2.0.14. - See http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.0.13+%2F+2013-10-24 + See http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.0.14+%2F+2013-11-12 for release notes. * Updated to 2.0.10. This fixes CVE_2013-4363: diff --git a/lib/rubygems.rb b/lib/rubygems.rb index a5857d810d..7114a3b1e0 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -8,7 +8,7 @@ require 'rbconfig' module Gem - VERSION = '2.0.13' + VERSION = '2.0.14' end # Must be first since it unloads the prelude from 1.9.2 diff --git a/lib/rubygems/dependency_installer.rb b/lib/rubygems/dependency_installer.rb index 6f19a310f7..ee361db94b 100644 --- a/lib/rubygems/dependency_installer.rb +++ b/lib/rubygems/dependency_installer.rb @@ -278,6 +278,14 @@ class Gem::DependencyInstaller if gem_name =~ /\.gem$/ and File.file? gem_name then src = Gem::Source::SpecificFile.new(gem_name) set.add src.spec, src + elsif gem_name =~ /\.gem$/ then + Dir[gem_name].each do |name| + begin + src = Gem::Source::SpecificFile.new name + set.add src.spec, src + rescue Gem::Package::FormatError + end + end else local = Gem::Source::Local.new diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index 87557cee5f..cc31c898f3 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -1027,9 +1027,6 @@ class Gem::Specification # Removes +spec+ from the known specs. def self.remove_spec spec - # TODO: beat on the tests - raise "wtf: #{spec.full_name} not in #{all_names.inspect}" unless - _all.include? spec _all.delete spec end diff --git a/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem b/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem new file mode 100644 index 0000000000..9e6810ab70 --- /dev/null +++ b/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFAD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zy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2 +Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe +vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep ++OkuE6N36B9K +-----END CERTIFICATE----- diff --git a/test/rubygems/test_gem_dependency_installer.rb b/test/rubygems/test_gem_dependency_installer.rb index 2b95597d4b..f36f9f551a 100644 --- a/test/rubygems/test_gem_dependency_installer.rb +++ b/test/rubygems/test_gem_dependency_installer.rb @@ -854,6 +854,29 @@ class TestGemDependencyInstaller < Gem::TestCase assert_equal Gem::Source.new(@gem_repo), s.source end + def test_find_spec_by_name_and_version_wildcard + util_gem 'a', 1 + FileUtils.mv 'gems/a-1.gem', @tempdir + + FileUtils.touch 'rdoc.gem' + + inst = Gem::DependencyInstaller.new + + available = inst.find_spec_by_name_and_version('*.gem') + + assert_equal %w[a-1], available.all_specs.map { |spec| spec.full_name } + end + + def test_find_spec_by_name_and_version_wildcard_bad_gem + FileUtils.touch 'rdoc.gem' + + inst = Gem::DependencyInstaller.new + + assert_raises Gem::Package::FormatError do + inst.find_spec_by_name_and_version '*.gem' + end + end + def test_find_spec_by_name_and_version_bad_gem FileUtils.touch 'rdoc.gem' diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb index e960354e6b..24ab8151fe 100644 --- a/test/rubygems/test_gem_remote_fetcher.rb +++ b/test/rubygems/test_gem_remote_fetcher.rb @@ -69,12 +69,6 @@ gems: PROXY_DATA = SERVER_DATA.gsub(/0.4.11/, '0.4.2') - # don't let 1.8 and 1.9 autotest collide - RUBY_VERSION =~ /(\d+)\.(\d+)\.(\d+)/ - # don't let parallel runners collide - PROXY_PORT = process_based_port + 100 + $1.to_i * 100 + $2.to_i * 10 + $3.to_i - SERVER_PORT = process_based_port + 200 + $1.to_i * 100 + $2.to_i * 10 + $3.to_i - DIR = File.expand_path(File.dirname(__FILE__)) def setup @@ -87,8 +81,8 @@ gems: self.class.enable_yaml = true self.class.enable_zip = false - base_server_uri = "http://localhost:#{SERVER_PORT}" - @proxy_uri = "http://localhost:#{PROXY_PORT}" + base_server_uri = "http://localhost:#{self.class.normal_server_port}" + @proxy_uri = "http://localhost:#{self.class.proxy_server_port}" @server_uri = base_server_uri + "/yaml" @server_z_uri = base_server_uri + "/yaml.Z" @@ -925,12 +919,20 @@ gems: attr_accessor :enable_zip, :enable_yaml def start_servers - @normal_server ||= start_server(SERVER_PORT, SERVER_DATA) - @proxy_server ||= start_server(PROXY_PORT, PROXY_DATA) + @normal_server ||= start_server(SERVER_DATA) + @proxy_server ||= start_server(PROXY_DATA) @enable_yaml = true @enable_zip = false end + def normal_server_port + @normal_server[:server].config[:Port] + end + + def proxy_server_port + @proxy_server[:server].config[:Port] + end + DIR = File.expand_path(File.dirname(__FILE__)) DH_PARAM = OpenSSL::PKey::DH.new(128) @@ -976,45 +978,45 @@ gems: private - def start_server(port, data) - Thread.new do + def start_server(data) + null_logger = NilLog.new + s = WEBrick::HTTPServer.new( + :Port => 0, + :DocumentRoot => nil, + :Logger => null_logger, + :AccessLog => null_logger + ) + s.mount_proc("/kill") { |req, res| s.shutdown } + s.mount_proc("/yaml") { |req, res| + if @enable_yaml + res.body = data + res['Content-Type'] = 'text/plain' + res['content-length'] = data.size + else + res.status = "404" + res.body = "<h1>NOT FOUND</h1>" + res['Content-Type'] = 'text/html' + end + } + s.mount_proc("/yaml.Z") { |req, res| + if @enable_zip + res.body = Zlib::Deflate.deflate(data) + res['Content-Type'] = 'text/plain' + else + res.status = "404" + res.body = "<h1>NOT FOUND</h1>" + res['Content-Type'] = 'text/html' + end + } + th = Thread.new do begin - null_logger = NilLog.new - s = WEBrick::HTTPServer.new( - :Port => port, - :DocumentRoot => nil, - :Logger => null_logger, - :AccessLog => null_logger - ) - s.mount_proc("/kill") { |req, res| s.shutdown } - s.mount_proc("/yaml") { |req, res| - if @enable_yaml - res.body = data - res['Content-Type'] = 'text/plain' - res['content-length'] = data.size - else - res.status = "404" - res.body = "<h1>NOT FOUND</h1>" - res['Content-Type'] = 'text/html' - end - } - s.mount_proc("/yaml.Z") { |req, res| - if @enable_zip - res.body = Zlib::Deflate.deflate(data) - res['Content-Type'] = 'text/plain' - else - res.status = "404" - res.body = "<h1>NOT FOUND</h1>" - res['Content-Type'] = 'text/html' - end - } s.start rescue Exception => ex - abort ex.message - puts "ERROR during server thread: #{ex.message}" + abort "ERROR during server thread: #{ex.message}" end end - sleep 0.2 # Give the servers time to startup + th[:server] = s + th end def cert(filename) diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index 9b2ae82fe3..9c1064e22b 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -449,6 +449,28 @@ dependencies: [] assert_equal %w[a], Gem::Specification.outdated end + def test_self_remove_spec + assert_includes Gem::Specification.all_names, 'a-1' + + Gem::Specification.remove_spec @a1 + + refute_includes Gem::Specification.all_names, 'a-1' + end + + def test_self_remove_spec_removed + open @a1.spec_file, 'w' do |io| + io.write @a1.to_ruby + end + + Gem::Specification.reset + + FileUtils.rm @a1.spec_file # bug #698 + + Gem::Specification.remove_spec @a1 + + refute_includes Gem::Specification.all_names, 'a-1' + end + DATA_PATH = File.expand_path "../data", __FILE__ def test_handles_private_null_type @@ -1,10 +1,10 @@ #define RUBY_VERSION "2.0.0" -#define RUBY_RELEASE_DATE "2013-11-12" -#define RUBY_PATCHLEVEL 349 +#define RUBY_RELEASE_DATE "2013-11-13" +#define RUBY_PATCHLEVEL 350 #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 11 -#define RUBY_RELEASE_DAY 12 +#define RUBY_RELEASE_DAY 13 #include "ruby/version.h" |