ruby-changes:5944
From: drbrain <ko1@a...>
Date: Fri, 20 Jun 2008 03:21:42 +0900 (JST)
Subject: [ruby-changes:5944] Ruby:r17452 (trunk): Update to RubyGems 1.1.1 r1784 (pre 1.2)
drbrain 2008-06-20 03:15:26 +0900 (Fri, 20 Jun 2008) New Revision: 17452 Modified files: trunk/ChangeLog trunk/lib/rubygems/commands/dependency_command.rb trunk/lib/rubygems/config_file.rb trunk/test/rubygems/test_gem.rb trunk/test/rubygems/test_gem_commands_dependency_command.rb trunk/test/rubygems/test_gem_config_file.rb trunk/test/rubygems/test_gem_dependency_installer.rb trunk/test/rubygems/test_gem_installer.rb trunk/test/rubygems/test_gem_source_info_cache.rb trunk/test/rubygems/test_gem_spec_fetcher.rb Log: Update to RubyGems 1.1.1 r1784 (pre 1.2) http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/rubygems/test_gem_source_info_cache.rb?r1=17452&r2=17451&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/rubygems/test_gem_config_file.rb?r1=17452&r2=17451&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/rubygems/test_gem_commands_dependency_command.rb?r1=17452&r2=17451&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/rubygems/test_gem_spec_fetcher.rb?r1=17452&r2=17451&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/rubygems/test_gem.rb?r1=17452&r2=17451&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=17452&r2=17451&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/rubygems/commands/dependency_command.rb?r1=17452&r2=17451&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/rubygems/config_file.rb?r1=17452&r2=17451&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/rubygems/test_gem_installer.rb?r1=17452&r2=17451&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/rubygems/test_gem_dependency_installer.rb?r1=17452&r2=17451&diff_format=u Index: ChangeLog =================================================================== --- ChangeLog (revision 17451) +++ ChangeLog (revision 17452) @@ -1,3 +1,8 @@ +Fri Jun 20 03:14:31 2008 Eric Hodel <drbrain@s...> + + * lib/rubygems*, test/rubygems/*: Update to RubyGems 1.1.1 r1784 (pre + 1.2). + Fri Jun 20 03:01:59 2008 Yusuke Endoh <mame@t...> * thread.c: try to remove false positive of deadlock detection (second Index: lib/rubygems/config_file.rb =================================================================== --- lib/rubygems/config_file.rb (revision 17451) +++ lib/rubygems/config_file.rb (revision 17452) @@ -79,6 +79,7 @@ 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 Index: lib/rubygems/commands/dependency_command.rb =================================================================== --- lib/rubygems/commands/dependency_command.rb (revision 17451) +++ lib/rubygems/commands/dependency_command.rb (revision 17452) @@ -43,14 +43,21 @@ 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 Index: test/rubygems/test_gem_spec_fetcher.rb =================================================================== --- test/rubygems/test_gem_spec_fetcher.rb (revision 17451) +++ test/rubygems/test_gem_spec_fetcher.rb (revision 17452) @@ -284,7 +284,7 @@ @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 Index: test/rubygems/test_gem_dependency_installer.rb =================================================================== --- test/rubygems/test_gem_dependency_installer.rb (revision 17451) +++ test/rubygems/test_gem_dependency_installer.rb (revision 17452) @@ -372,7 +372,7 @@ 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 Index: test/rubygems/test_gem_source_info_cache.rb =================================================================== --- test/rubygems/test_gem_source_info_cache.rb (revision 17451) +++ test/rubygems/test_gem_source_info_cache.rb (revision 17452) @@ -401,7 +401,7 @@ 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 Index: test/rubygems/test_gem_config_file.rb =================================================================== --- test/rubygems/test_gem_config_file.rb (revision 17451) +++ test/rubygems/test_gem_config_file.rb (revision 17452) @@ -72,6 +72,12 @@ 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}] Index: test/rubygems/test_gem.rb =================================================================== --- test/rubygems/test_gem.rb (revision 17451) +++ test/rubygems/test_gem.rb (revision 17452) @@ -27,7 +27,7 @@ assert_equal expected, Gem.all_load_paths.sort end - + def test_self_available? util_make_gems assert(Gem.available?("a")) @@ -252,7 +252,7 @@ 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 Index: test/rubygems/test_gem_installer.rb =================================================================== --- test/rubygems/test_gem_installer.rb (revision 17451) +++ test/rubygems/test_gem_installer.rb (revision 17452) @@ -327,8 +327,10 @@ 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) Index: test/rubygems/test_gem_commands_dependency_command.rb =================================================================== --- test/rubygems/test_gem_commands_dependency_command.rb (revision 17451) +++ test/rubygems/test_gem_commands_dependency_command.rb (revision 17452) @@ -30,6 +30,34 @@ 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 @@ 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' -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/