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

ruby-changes:30868

From: nagachika <ko1@a...>
Date: Sun, 15 Sep 2013 23:23:38 +0900 (JST)
Subject: [ruby-changes:30868] nagachika:r42947 (ruby_2_0_0): * lib/rubygems: Update to Rubygems 2.0.9.

nagachika	2013-09-15 23:23:26 +0900 (Sun, 15 Sep 2013)

  New Revision: 42947

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

  Log:
    * lib/rubygems: Update to Rubygems 2.0.9. [ruby-core:57183]
      [Backport #8908]
      the patch is provided by drbrain (Eric Hodel).

  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/NEWS
    branches/ruby_2_0_0/lib/rubygems/commands/fetch_command.rb
    branches/ruby_2_0_0/lib/rubygems/gemcutter_utilities.rb
    branches/ruby_2_0_0/lib/rubygems.rb
    branches/ruby_2_0_0/test/rubygems/test_gem_commands_fetch_command.rb
    branches/ruby_2_0_0/test/rubygems/test_gem_gemcutter_utilities.rb
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 42946)
+++ ruby_2_0_0/ChangeLog	(revision 42947)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Sun Sep 15 23:15:32 2013  CHIKANAGA Tomoyuki  <nagachika@r...>
+
+	* lib/rubygems: Update to Rubygems 2.0.9. [ruby-core:57183]
+	  [Backport #8908]
+	  the patch is provided by drbrain (Eric Hodel).
+
 Sun Sep 15 22:59:04 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* tool/rbinstall.rb (Gem::Specification#initialize): default date to
@@ -22,7 +28,7 @@ Sun Sep 15 22:03:01 2013  Nobuyoshi Naka https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L28
 
 Sat Sep 14 00:01:20 2013  CHIKANAGA Tomoyuki  <nagachika@r...>
 
-	* lib/rubygems: Update to RubyGems to 2.0.8. [ruby-core:57155]
+	* lib/rubygems: Update to RubyGems 2.0.8. [ruby-core:57155]
 	  [Backport #8900]
 	  the patch is provided by drbrain (Eric Hodel).
 	  this update contains a security fix for CVE-2013-4287.
Index: ruby_2_0_0/lib/rubygems/gemcutter_utilities.rb
===================================================================
--- ruby_2_0_0/lib/rubygems/gemcutter_utilities.rb	(revision 42946)
+++ ruby_2_0_0/lib/rubygems/gemcutter_utilities.rb	(revision 42947)
@@ -27,7 +27,8 @@ module Gem::GemcutterUtilities https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/rubygems/gemcutter_utilities.rb#L27
     end
   end
 
-  def sign_in sign_in_host = self.host
+  def sign_in sign_in_host = nil
+    sign_in_host ||= self.host
     return if Gem.configuration.rubygems_api_key
 
     pretty_host = if Gem::DEFAULT_HOST == sign_in_host then
Index: ruby_2_0_0/lib/rubygems/commands/fetch_command.rb
===================================================================
--- ruby_2_0_0/lib/rubygems/commands/fetch_command.rb	(revision 42946)
+++ ruby_2_0_0/lib/rubygems/commands/fetch_command.rb	(revision 42947)
@@ -43,12 +43,13 @@ class Gem::Commands::FetchCommand < Gem: https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/rubygems/commands/fetch_command.rb#L43
       dep.prerelease = options[:prerelease]
 
       specs_and_sources, errors = Gem::SpecFetcher.fetcher.spec_for_dependency dep
+
       if platform then
         filtered = specs_and_sources.select { |s,| s.platform == platform }
         specs_and_sources = filtered unless filtered.empty?
       end
 
-      spec, source = specs_and_sources.sort_by { |s,| s.version }.first
+      spec, source = specs_and_sources.max_by { |s,| s.version }
 
       if spec.nil? then
         show_lookup_failure gem_name, version, errors, options[:domain]
Index: ruby_2_0_0/lib/rubygems.rb
===================================================================
--- ruby_2_0_0/lib/rubygems.rb	(revision 42946)
+++ ruby_2_0_0/lib/rubygems.rb	(revision 42947)
@@ -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.8'
+  VERSION = '2.0.9'
 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 42946)
+++ ruby_2_0_0/NEWS	(revision 42947)
@@ -461,14 +461,15 @@ 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.9.
+
+    http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.0.9+%2F+2013-09-13
+    for release notes.
+
   * Updated to 2.0.8.  This fixes CVE-2013-4287:
 
     http://rubygems.rubyforge.org/rubygems-update/CVE-2013-4287_txt.html
 
-  * Updated to 2.0.3.  See
-    http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.0.3+%2F+2012-03-1
-    for release notes.
-
   * Updated to 2.0.0
 
     RubyGems 2.0.0 features the following improvements:
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 42946)
+++ ruby_2_0_0/version.h	(revision 42947)
@@ -1,6 +1,6 @@ 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-09-15"
-#define RUBY_PATCHLEVEL 316
+#define RUBY_PATCHLEVEL 317
 
 #define RUBY_RELEASE_YEAR 2013
 #define RUBY_RELEASE_MONTH 9
Index: ruby_2_0_0/test/rubygems/test_gem_gemcutter_utilities.rb
===================================================================
--- ruby_2_0_0/test/rubygems/test_gem_gemcutter_utilities.rb	(revision 42946)
+++ ruby_2_0_0/test/rubygems/test_gem_gemcutter_utilities.rb	(revision 42947)
@@ -101,7 +101,7 @@ class TestGemGemcutterUtilities < Gem::T https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/rubygems/test_gem_gemcutter_utilities.rb#L101
   def test_sign_in_with_host
     api_key     = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
 
-    util_sign_in [api_key, 200, 'OK'], 'http://example.com', :param
+    util_sign_in [api_key, 200, 'OK'], 'http://example.com', ['http://example.com']
 
     assert_match "Enter your http://example.com credentials.",
                  @sign_in_ui.output
@@ -112,6 +112,20 @@ class TestGemGemcutterUtilities < Gem::T https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/rubygems/test_gem_gemcutter_utilities.rb#L112
     assert_equal api_key, credentials[:rubygems_api_key]
   end
 
+  def test_sign_in_with_host_nil
+    api_key     = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
+
+    util_sign_in [api_key, 200, 'OK'], nil, [nil]
+
+    assert_match "Enter your RubyGems.org credentials.",
+                 @sign_in_ui.output
+    assert @fetcher.last_request["authorization"]
+    assert_match %r{Signed in.}, @sign_in_ui.output
+
+    credentials = YAML.load_file Gem.configuration.credentials_path
+    assert_equal api_key, credentials[:rubygems_api_key]
+  end
+
   def test_sign_in_with_host_ENV
     api_key     = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
     util_sign_in [api_key, 200, 'OK'], 'http://example.com'
@@ -163,14 +177,14 @@ class TestGemGemcutterUtilities < Gem::T https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/rubygems/test_gem_gemcutter_utilities.rb#L177
     assert_match %r{Access Denied.}, @sign_in_ui.output
   end
 
-  def util_sign_in response, host = nil, style = :ENV
+  def util_sign_in response, host = nil, args = []
     skip 'Always uses $stdin on windows' if Gem.win_platform?
 
     email    = 'you@e...'
     password = 'secret'
 
     if host
-      ENV['RUBYGEMS_HOST'] = host if style == :ENV
+      ENV['RUBYGEMS_HOST'] = host
     else
       host = Gem.host
     end
@@ -182,8 +196,8 @@ class TestGemGemcutterUtilities < Gem::T https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/rubygems/test_gem_gemcutter_utilities.rb#L196
     @sign_in_ui = Gem::MockGemUi.new "#{email}\n#{password}\n"
 
     use_ui @sign_in_ui do
-      if style == :param then
-        @cmd.sign_in host
+      if args.length > 0 then
+        @cmd.sign_in(*args)
       else
         @cmd.sign_in
       end
@@ -209,4 +223,3 @@ class TestGemGemcutterUtilities < Gem::T https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/rubygems/test_gem_gemcutter_utilities.rb#L223
   end
 
 end
-
Index: ruby_2_0_0/test/rubygems/test_gem_commands_fetch_command.rb
===================================================================
--- ruby_2_0_0/test/rubygems/test_gem_commands_fetch_command.rb	(revision 42946)
+++ ruby_2_0_0/test/rubygems/test_gem_commands_fetch_command.rb	(revision 42947)
@@ -34,6 +34,32 @@ class TestGemCommandsFetchCommand < Gem: https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/rubygems/test_gem_commands_fetch_command.rb#L34
                        'gem repository directories must not be created'
   end
 
+  def test_execute_latest
+    util_setup_fake_fetcher
+    util_setup_spec_fetcher @a1, @a2
+
+    @fetcher.data["#{@gem_repo}gems/#{@a1.file_name}"] =
+      File.read(@a1.cache_file)
+    @fetcher.data["#{@gem_repo}gems/#{@a2.file_name}"] =
+      File.read(@a2.cache_file)
+
+    refute_path_exists File.join(@tempdir, 'cache'), 'sanity check'
+
+    @cmd.options[:args] = [@a2.name]
+    @cmd.options[:version] = req('>= 0.1')
+
+    use_ui @ui do
+      Dir.chdir @tempdir do
+        @cmd.execute
+      end
+    end
+
+    assert_path_exists(File.join(@tempdir, @a2.file_name),
+                       "#{@a2.full_name} not fetched")
+    refute_path_exists File.join(@tempdir, 'cache'),
+                       'gem repository directories must not be created'
+  end
+
   def test_execute_prerelease
     util_setup_fake_fetcher true
     util_clear_gems
@@ -53,8 +79,8 @@ class TestGemCommandsFetchCommand < Gem: https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/rubygems/test_gem_commands_fetch_command.rb#L79
       end
     end
 
-    assert_path_exists(File.join(@tempdir, @a2_pre.file_name),
-                       "#{@a2_pre.full_name} not fetched")
+    assert_path_exists(File.join(@tempdir, @a2.file_name),
+                       "#{@a2.full_name} not fetched")
   end
 
   def test_execute_specific_prerelease

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

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