diff options
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | lib/rubygems/commands/contents_command.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_contents_command.rb | 8 |
3 files changed, 17 insertions, 5 deletions
@@ -1,3 +1,15 @@ +Tue Nov 11 13:01:31 2014 NARUSE, Yui <naruse@ruby-lang.org> + + * 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@atdot.net> * string.c (sym_equal): use rb_obj_equal(). diff --git a/lib/rubygems/commands/contents_command.rb b/lib/rubygems/commands/contents_command.rb index 15657f31a2..9a1c6c532f 100644 --- a/lib/rubygems/commands/contents_command.rb +++ b/lib/rubygems/commands/contents_command.rb @@ -102,7 +102,7 @@ prefix or only the files that are requireable. 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] diff --git a/test/rubygems/test_gem_commands_contents_command.rb b/test/rubygems/test_gem_commands_contents_command.rb index fb6906afd2..19e188efa5 100644 --- a/test/rubygems/test_gem_commands_contents_command.rb +++ b/test/rubygems/test_gem_commands_contents_command.rb @@ -203,10 +203,10 @@ lib/foo.rb 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 |