diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-15 14:23:26 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-15 14:23:26 +0000 |
commit | 72fb9d16dc0301bd142f05b73f15b015afd22125 (patch) | |
tree | 6a02c00e24a11233284ce96e5da10be9340725e2 | |
parent | 9aab347c155b4b202947e31af20cf96afed11764 (diff) |
* lib/rubygems: Update to Rubygems 2.0.9. [ruby-core:57183]
[Backport #8908]
the patch is provided by drbrain (Eric Hodel).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | NEWS | 9 | ||||
-rw-r--r-- | lib/rubygems.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/fetch_command.rb | 3 | ||||
-rw-r--r-- | lib/rubygems/gemcutter_utilities.rb | 3 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_fetch_command.rb | 30 | ||||
-rw-r--r-- | test/rubygems/test_gem_gemcutter_utilities.rb | 25 | ||||
-rw-r--r-- | version.h | 2 |
8 files changed, 65 insertions, 17 deletions
@@ -1,3 +1,9 @@ +Sun Sep 15 23:15:32 2013 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org> + + * 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@ruby-lang.org> * tool/rbinstall.rb (Gem::Specification#initialize): default date to @@ -22,7 +28,7 @@ Sun Sep 15 22:03:01 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> Sat Sep 14 00:01:20 2013 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org> - * 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. @@ -461,14 +461,15 @@ with all sufficient information, see the ChangeLog file. 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: diff --git a/lib/rubygems.rb b/lib/rubygems.rb index 78bdc4867d..f8633d50df 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -8,7 +8,7 @@ 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 diff --git a/lib/rubygems/commands/fetch_command.rb b/lib/rubygems/commands/fetch_command.rb index ec021359b6..f5a8abc349 100644 --- a/lib/rubygems/commands/fetch_command.rb +++ b/lib/rubygems/commands/fetch_command.rb @@ -43,12 +43,13 @@ class Gem::Commands::FetchCommand < Gem::Command 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] diff --git a/lib/rubygems/gemcutter_utilities.rb b/lib/rubygems/gemcutter_utilities.rb index 04d7cd300f..c0628ebfb5 100644 --- a/lib/rubygems/gemcutter_utilities.rb +++ b/lib/rubygems/gemcutter_utilities.rb @@ -27,7 +27,8 @@ module Gem::GemcutterUtilities 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 diff --git a/test/rubygems/test_gem_commands_fetch_command.rb b/test/rubygems/test_gem_commands_fetch_command.rb index 924f4c44e7..364881a132 100644 --- a/test/rubygems/test_gem_commands_fetch_command.rb +++ b/test/rubygems/test_gem_commands_fetch_command.rb @@ -34,6 +34,32 @@ class TestGemCommandsFetchCommand < Gem::TestCase '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::TestCase 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 diff --git a/test/rubygems/test_gem_gemcutter_utilities.rb b/test/rubygems/test_gem_gemcutter_utilities.rb index 18b4518b06..d70ac35beb 100644 --- a/test/rubygems/test_gem_gemcutter_utilities.rb +++ b/test/rubygems/test_gem_gemcutter_utilities.rb @@ -101,7 +101,7 @@ class TestGemGemcutterUtilities < Gem::TestCase 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::TestCase 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::TestCase 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@example.com' 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::TestCase @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::TestCase end end - @@ -1,6 +1,6 @@ #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 |