Project

General

Profile

Backport #8908 ยป rubygems.2_0_9.ruby.2_0_0.patch

drbrain (Eric Hodel), 09/14/2013 09:35 AM

View differences:

NEWS (working copy)
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:
lib/rubygems/commands/fetch_command.rb (working copy)
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]
lib/rubygems/gemcutter_utilities.rb (working copy)
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
lib/rubygems.rb (working copy)
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
test/rubygems/test_gem_commands_fetch_command.rb (working copy)
'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
......
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
test/rubygems/test_gem_gemcutter_utilities.rb (working copy)
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
......
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'
......
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
......
@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
......
end
end
    (1-1/1)