ruby-changes:36289
From: naruse <ko1@a...>
Date: Tue, 11 Nov 2014 14:09:14 +0900 (JST)
Subject: [ruby-changes:36289] naruse:r48370 (trunk): * lib/rubygems/commands/contents_command.rb (files_in_default_gem):
naruse 2014-11-11 14:08:59 +0900 (Tue, 11 Nov 2014) New Revision: 48370 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48370 Log: * lib/rubygems/commands/contents_command.rb (files_in_default_gem): remove useless sort. show_files will sort the result and another branch, files_in_gem, doesn't sort. it should be removed for consistency. * test/rubygems/test_gem_commands_contents_command.rb (test_execute_default_gem): adjust the sort algorithm with Gem::Commands::ContentsCommand#show_files, which sort items as array of [prefix, basename] not strings. Modified files: trunk/ChangeLog trunk/lib/rubygems/commands/contents_command.rb trunk/test/rubygems/test_gem_commands_contents_command.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 48369) +++ ChangeLog (revision 48370) @@ -1,3 +1,15 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Nov 11 13:01:31 2014 NARUSE, Yui <naruse@r...> + + * lib/rubygems/commands/contents_command.rb (files_in_default_gem): + remove useless sort. show_files will sort the result and + another branch, files_in_gem, doesn't sort. + it should be removed for consistency. + + * test/rubygems/test_gem_commands_contents_command.rb + (test_execute_default_gem): adjust the sort algorithm with + Gem::Commands::ContentsCommand#show_files, which sort items + as array of [prefix, basename] not strings. + Tue Nov 11 10:37:09 2014 Koichi Sasada <ko1@a...> * string.c (sym_equal): use rb_obj_equal(). Index: lib/rubygems/commands/contents_command.rb =================================================================== --- lib/rubygems/commands/contents_command.rb (revision 48369) +++ lib/rubygems/commands/contents_command.rb (revision 48370) @@ -102,7 +102,7 @@ prefix or only the files that are requir https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/contents_command.rb#L102 end def files_in_default_gem spec - spec.files.sort.map do |file| + spec.files.map do |file| case file when /\A#{spec.bindir}\// [RbConfig::CONFIG['bindir'], $POSTMATCH] Index: test/rubygems/test_gem_commands_contents_command.rb =================================================================== --- test/rubygems/test_gem_commands_contents_command.rb (revision 48369) +++ test/rubygems/test_gem_commands_contents_command.rb (revision 48370) @@ -203,10 +203,10 @@ lib/foo.rb https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_contents_command.rb#L203 end expected = [ - File.join(RbConfig::CONFIG['bindir'], 'default_command'), - File.join(RbConfig::CONFIG['rubylibdir'], 'default/gem.rb'), - File.join(RbConfig::CONFIG['archdir'], 'default_gem.so') - ].sort.join "\n" + [RbConfig::CONFIG['bindir'], 'default_command'], + [RbConfig::CONFIG['rubylibdir'], 'default/gem.rb'], + [RbConfig::CONFIG['archdir'].sub(/x86_64/,'armv7l'), 'default_gem.so'] + ].sort.map{|a|File.join a}.join "\n" assert_equal expected, @ui.output.chomp assert_equal "", @ui.error -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/