mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
* 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
This commit is contained in:
parent
9aab347c15
commit
72fb9d16dc
8 changed files with 65 additions and 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>
|
Sun Sep 15 22:59:04 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* tool/rbinstall.rb (Gem::Specification#initialize): default date to
|
* 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>
|
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]
|
[Backport #8900]
|
||||||
the patch is provided by drbrain (Eric Hodel).
|
the patch is provided by drbrain (Eric Hodel).
|
||||||
this update contains a security fix for CVE-2013-4287.
|
this update contains a security fix for CVE-2013-4287.
|
||||||
|
|
9
NEWS
9
NEWS
|
@ -461,14 +461,15 @@ with all sufficient information, see the ChangeLog file.
|
||||||
XML declaration is used for XML document encoding.
|
XML declaration is used for XML document encoding.
|
||||||
|
|
||||||
* RubyGems
|
* 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:
|
* Updated to 2.0.8. This fixes CVE-2013-4287:
|
||||||
|
|
||||||
http://rubygems.rubyforge.org/rubygems-update/CVE-2013-4287_txt.html
|
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
|
* Updated to 2.0.0
|
||||||
|
|
||||||
RubyGems 2.0.0 features the following improvements:
|
RubyGems 2.0.0 features the following improvements:
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
require 'rbconfig'
|
require 'rbconfig'
|
||||||
|
|
||||||
module Gem
|
module Gem
|
||||||
VERSION = '2.0.8'
|
VERSION = '2.0.9'
|
||||||
end
|
end
|
||||||
|
|
||||||
# Must be first since it unloads the prelude from 1.9.2
|
# Must be first since it unloads the prelude from 1.9.2
|
||||||
|
|
|
@ -43,12 +43,13 @@ class Gem::Commands::FetchCommand < Gem::Command
|
||||||
dep.prerelease = options[:prerelease]
|
dep.prerelease = options[:prerelease]
|
||||||
|
|
||||||
specs_and_sources, errors = Gem::SpecFetcher.fetcher.spec_for_dependency dep
|
specs_and_sources, errors = Gem::SpecFetcher.fetcher.spec_for_dependency dep
|
||||||
|
|
||||||
if platform then
|
if platform then
|
||||||
filtered = specs_and_sources.select { |s,| s.platform == platform }
|
filtered = specs_and_sources.select { |s,| s.platform == platform }
|
||||||
specs_and_sources = filtered unless filtered.empty?
|
specs_and_sources = filtered unless filtered.empty?
|
||||||
end
|
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
|
if spec.nil? then
|
||||||
show_lookup_failure gem_name, version, errors, options[:domain]
|
show_lookup_failure gem_name, version, errors, options[:domain]
|
||||||
|
|
|
@ -27,7 +27,8 @@ module Gem::GemcutterUtilities
|
||||||
end
|
end
|
||||||
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
|
return if Gem.configuration.rubygems_api_key
|
||||||
|
|
||||||
pretty_host = if Gem::DEFAULT_HOST == sign_in_host then
|
pretty_host = if Gem::DEFAULT_HOST == sign_in_host then
|
||||||
|
|
|
@ -34,6 +34,32 @@ class TestGemCommandsFetchCommand < Gem::TestCase
|
||||||
'gem repository directories must not be created'
|
'gem repository directories must not be created'
|
||||||
end
|
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
|
def test_execute_prerelease
|
||||||
util_setup_fake_fetcher true
|
util_setup_fake_fetcher true
|
||||||
util_clear_gems
|
util_clear_gems
|
||||||
|
@ -53,8 +79,8 @@ class TestGemCommandsFetchCommand < Gem::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_path_exists(File.join(@tempdir, @a2_pre.file_name),
|
assert_path_exists(File.join(@tempdir, @a2.file_name),
|
||||||
"#{@a2_pre.full_name} not fetched")
|
"#{@a2.full_name} not fetched")
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_execute_specific_prerelease
|
def test_execute_specific_prerelease
|
||||||
|
|
|
@ -101,7 +101,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
||||||
def test_sign_in_with_host
|
def test_sign_in_with_host
|
||||||
api_key = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
|
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.",
|
assert_match "Enter your http://example.com credentials.",
|
||||||
@sign_in_ui.output
|
@sign_in_ui.output
|
||||||
|
@ -112,6 +112,20 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
||||||
assert_equal api_key, credentials[:rubygems_api_key]
|
assert_equal api_key, credentials[:rubygems_api_key]
|
||||||
end
|
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
|
def test_sign_in_with_host_ENV
|
||||||
api_key = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
|
api_key = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
|
||||||
util_sign_in [api_key, 200, 'OK'], 'http://example.com'
|
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
|
assert_match %r{Access Denied.}, @sign_in_ui.output
|
||||||
end
|
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?
|
skip 'Always uses $stdin on windows' if Gem.win_platform?
|
||||||
|
|
||||||
email = 'you@example.com'
|
email = 'you@example.com'
|
||||||
password = 'secret'
|
password = 'secret'
|
||||||
|
|
||||||
if host
|
if host
|
||||||
ENV['RUBYGEMS_HOST'] = host if style == :ENV
|
ENV['RUBYGEMS_HOST'] = host
|
||||||
else
|
else
|
||||||
host = Gem.host
|
host = Gem.host
|
||||||
end
|
end
|
||||||
|
@ -182,8 +196,8 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
||||||
@sign_in_ui = Gem::MockGemUi.new "#{email}\n#{password}\n"
|
@sign_in_ui = Gem::MockGemUi.new "#{email}\n#{password}\n"
|
||||||
|
|
||||||
use_ui @sign_in_ui do
|
use_ui @sign_in_ui do
|
||||||
if style == :param then
|
if args.length > 0 then
|
||||||
@cmd.sign_in host
|
@cmd.sign_in(*args)
|
||||||
else
|
else
|
||||||
@cmd.sign_in
|
@cmd.sign_in
|
||||||
end
|
end
|
||||||
|
@ -209,4 +223,3 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#define RUBY_VERSION "2.0.0"
|
#define RUBY_VERSION "2.0.0"
|
||||||
#define RUBY_RELEASE_DATE "2013-09-15"
|
#define RUBY_RELEASE_DATE "2013-09-15"
|
||||||
#define RUBY_PATCHLEVEL 316
|
#define RUBY_PATCHLEVEL 317
|
||||||
|
|
||||||
#define RUBY_RELEASE_YEAR 2013
|
#define RUBY_RELEASE_YEAR 2013
|
||||||
#define RUBY_RELEASE_MONTH 9
|
#define RUBY_RELEASE_MONTH 9
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue