[前][次][番号順一覧][スレッド一覧]

ruby-changes:31582

From: nagachika <ko1@a...>
Date: Wed, 13 Nov 2013 11:59:21 +0900 (JST)
Subject: [ruby-changes:31582] nagachika:r43661 (ruby_2_0_0): * lib/rubygems: Update to RubyGems 2.0.14.

nagachika	2013-11-13 11:59:08 +0900 (Wed, 13 Nov 2013)

  New Revision: 43661

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43661

  Log:
    * lib/rubygems: Update to RubyGems 2.0.14. [ruby-core:58300]
      [Backport #9104]
      the patch is provided by drbrain (Eric Hodel).

  Added files:
    branches/ruby_2_0_0/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/NEWS
    branches/ruby_2_0_0/lib/rubygems/dependency_installer.rb
    branches/ruby_2_0_0/lib/rubygems/specification.rb
    branches/ruby_2_0_0/lib/rubygems.rb
    branches/ruby_2_0_0/test/rubygems/test_gem_dependency_installer.rb
    branches/ruby_2_0_0/test/rubygems/test_gem_remote_fetcher.rb
    branches/ruby_2_0_0/test/rubygems/test_gem_specification.rb
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 43660)
+++ ruby_2_0_0/ChangeLog	(revision 43661)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Wed Nov 13 11:57:01 2013  CHIKANAGA Tomoyuki  <nagachika@r...>
+
+	* 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@r...>
 
 	* load.c (rb_feature_p): deal with default loadable suffixes.
Index: ruby_2_0_0/lib/rubygems/dependency_installer.rb
===================================================================
--- ruby_2_0_0/lib/rubygems/dependency_installer.rb	(revision 43660)
+++ ruby_2_0_0/lib/rubygems/dependency_installer.rb	(revision 43661)
@@ -278,6 +278,14 @@ class Gem::DependencyInstaller https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/rubygems/dependency_installer.rb#L278
       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
 
Index: ruby_2_0_0/lib/rubygems/specification.rb
===================================================================
--- ruby_2_0_0/lib/rubygems/specification.rb	(revision 43660)
+++ ruby_2_0_0/lib/rubygems/specification.rb	(revision 43661)
@@ -1027,9 +1027,6 @@ class Gem::Specification https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/rubygems/specification.rb#L1027
   # 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
 
Index: ruby_2_0_0/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem
===================================================================
--- ruby_2_0_0/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem	(revision 0)
+++ ruby_2_0_0/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem	(revision 43661)
@@ -0,0 +1,23 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem#L1
+-----BEGIN CERTIFICATE-----
+MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs
+MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
+d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ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CAx2/S6cCZdkGCe
+vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep
++OkuE6N36B9K
+-----END CERTIFICATE-----
Index: ruby_2_0_0/lib/rubygems.rb
===================================================================
--- ruby_2_0_0/lib/rubygems.rb	(revision 43660)
+++ ruby_2_0_0/lib/rubygems.rb	(revision 43661)
@@ -8,7 +8,7 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/rubygems.rb#L8
 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
Index: ruby_2_0_0/NEWS
===================================================================
--- ruby_2_0_0/NEWS	(revision 43660)
+++ ruby_2_0_0/NEWS	(revision 43661)
@@ -461,9 +461,9 @@ with all sufficient information, see the https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/NEWS#L461
     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:
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 43660)
+++ ruby_2_0_0/version.h	(revision 43661)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #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"
 
Index: ruby_2_0_0/test/rubygems/test_gem_remote_fetcher.rb
===================================================================
--- ruby_2_0_0/test/rubygems/test_gem_remote_fetcher.rb	(revision 43660)
+++ ruby_2_0_0/test/rubygems/test_gem_remote_fetcher.rb	(revision 43661)
@@ -69,12 +69,6 @@ gems: https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/rubygems/test_gem_remote_fetcher.rb#L69
 
   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: https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/rubygems/test_gem_remote_fetcher.rb#L81
     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: https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/rubygems/test_gem_remote_fetcher.rb#L919
     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: https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/rubygems/test_gem_remote_fetcher.rb#L978
 
     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)
Index: ruby_2_0_0/test/rubygems/test_gem_specification.rb
===================================================================
--- ruby_2_0_0/test/rubygems/test_gem_specification.rb	(revision 43660)
+++ ruby_2_0_0/test/rubygems/test_gem_specification.rb	(revision 43661)
@@ -449,6 +449,28 @@ dependencies: [] https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/rubygems/test_gem_specification.rb#L449
     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
Index: ruby_2_0_0/test/rubygems/test_gem_dependency_installer.rb
===================================================================
--- ruby_2_0_0/test/rubygems/test_gem_dependency_installer.rb	(revision 43660)
+++ ruby_2_0_0/test/rubygems/test_gem_dependency_installer.rb	(revision 43661)
@@ -854,6 +854,29 @@ class TestGemDependencyInstaller < Gem:: https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/rubygems/test_gem_dependency_installer.rb#L854
     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'
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]