1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Update to RubyGems 1.1.1 r1784 (pre 1.2)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2008-06-19 18:15:26 +00:00
parent 4394ffe521
commit 08837d081d
10 changed files with 82 additions and 9 deletions

View file

@ -1,3 +1,8 @@
Fri Jun 20 03:14:31 2008 Eric Hodel <drbrain@segment7.net>
* lib/rubygems*, test/rubygems/*: Update to RubyGems 1.1.1 r1784 (pre
1.2).
Fri Jun 20 03:01:59 2008 Yusuke Endoh <mame@tsg.ne.jp>
* thread.c: try to remove false positive of deadlock detection (second

View file

@ -43,14 +43,21 @@ class Gem::Commands::DependencyCommand < Gem::Command
end
def execute
options[:args] << '.' if options[:args].empty?
options[:args] << '' if options[:args].empty?
specs = {}
source_indexes = Hash.new do |h, source_uri|
h[source_uri] = Gem::SourceIndex.new
end
pattern = /\A#{Regexp.union(*options[:args])}/
pattern = if options[:args].length == 1 and
options[:args].first =~ /\A\/(.*)\/(i)?\z/m then
flags = $2 ? Regexp::IGNORECASE : nil
Regexp.new $1, flags
else
/\A#{Regexp.union(*options[:args])}/
end
dependency = Gem::Dependency.new pattern, options[:version]
if options[:reverse_dependencies] and remote? and not local? then

View file

@ -79,6 +79,7 @@ class Gem::ConfigFile
arg_list = arg_list.map do |arg|
if need_config_file_name then
@config_file_name = arg
need_config_file_name = false
nil
elsif arg =~ /^--config-file=(.*)/ then
@config_file_name = $1

View file

@ -252,7 +252,7 @@ class TestGem < RubyGemTestCase
end
Gem.instance_variable_set :@gem_path, nil
assert_equal [Gem.default_path, Gem.dir], Gem.path
assert_equal [Gem.default_path, Gem.dir].flatten, Gem.path
ensure
Object.const_set :APPLE_GEM_HOME, orig_APPLE_GEM_HOME
end

View file

@ -30,6 +30,34 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
assert_equal '', @ui.error
end
def test_execute_no_args
Gem.source_index = nil
@cmd.options[:args] = []
use_ui @ui do
@cmd.execute
end
expected = <<-EOF
Gem a-1
Gem a-2
Gem a_evil-9
Gem b-2
Gem c-1.2
Gem pl-1-x86-linux
EOF
assert_equal expected, @ui.output
assert_equal '', @ui.error
end
def test_execute_no_match
@cmd.options[:args] = %w[foo]
@ -59,6 +87,30 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
assert_equal '', @ui.error
end
def test_execute_regexp
Gem.source_index = nil
@cmd.options[:args] = %w[/[ab]/]
use_ui @ui do
@cmd.execute
end
expected = <<-EOF
Gem a-1
Gem a-2
Gem a_evil-9
Gem b-2
EOF
assert_equal expected, @ui.output
assert_equal '', @ui.error
end
def test_execute_reverse
quick_gem 'foo' do |gem|
gem.add_dependency 'bar', '> 1'

View file

@ -72,6 +72,12 @@ class TestGemConfigFile < RubyGemTestCase
assert_equal @temp_conf, @cfg.config_file_name
end
def test_initialize_handle_arguments_config_file_with_other_params
util_config_file %W[--config-file #{@temp_conf} --backtrace]
assert_equal @temp_conf, @cfg.config_file_name
end
def test_initialize_handle_arguments_config_file_equals
util_config_file %W[--config-file=#{@temp_conf}]

View file

@ -372,7 +372,7 @@ class TestGemDependencyInstaller < RubyGemTestCase
end
ENV['GEM_HOME'] = @gemhome
ENV['GEM_PATH'] = [@gemhome, gemhome2].join ':'
ENV['GEM_PATH'] = [@gemhome, gemhome2].join File::PATH_SEPARATOR
Gem.clear_paths
Dir.chdir @tempdir do

View file

@ -327,8 +327,10 @@ load 'my_exec'
real_exec = File.join util_gem_dir, 'bin', 'my_exec'
# fake --no-wrappers for previous install
FileUtils.mkdir_p File.dirname(installed_exec)
FileUtils.ln_s real_exec, installed_exec
unless Gem.win_platform? then
FileUtils.mkdir_p File.dirname(installed_exec)
FileUtils.ln_s real_exec, installed_exec
end
@installer.generate_bin
assert_equal true, File.directory?(util_inst_bindir)

View file

@ -401,7 +401,7 @@ class TestGemSourceInfoCache < RubyGemTestCase
assert_equal @gem_repo, user_cache_data.first
gems = user_cache_data.last.source_index.map { |_,spec| spec.full_name }
assert_equal [@a1.full_name, @a2.full_name], gems
assert_equal [@a1.full_name, @a2.full_name], gems.sort
user_cache_data = read_cache(@sic.latest_user_cache_file).to_a.sort
assert_equal 1, user_cache_data.length

View file

@ -284,7 +284,7 @@ RubyGems will revert to legacy indexes degrading performance.
@fetcher.data["#{@gem_repo}latest_specs.#{Gem.marshal_version}"] =
' ' * Marshal.dump(@latest_specs).length
cache_dir = File.join Gem.user_home, '.gem', 'specs', 'gems.example.com:80'
cache_dir = File.join Gem.user_home, '.gem', 'specs', 'gems.example.com%80'
FileUtils.mkdir_p cache_dir