Skip to content

Commit

Permalink
Apply patch from rubygems/rubygems#1685
Browse files Browse the repository at this point in the history
Fixes #4019
  • Loading branch information
etehtsea committed Oct 1, 2016
1 parent ed91cb4 commit 63fcab8
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions lib/ruby/stdlib/rubygems/commands/query_command.rb
Expand Up @@ -255,22 +255,21 @@ def entry_versions entry, name_tuples, platforms, specs
name_tuples.map { |n| n.version }.uniq
else
platforms.sort.reverse.map do |version, pls|
if pls == [Gem::Platform::RUBY] then
if options[:domain] == :remote || specs.all? { |spec| spec.is_a? Gem::Source }
version
else
spec = specs.select { |s| s.version == version }
if spec.first.default_gem?
"default: #{version}"
else
version
end
out = version.to_s

if options[:domain] == :local
default = specs.any? do |s|
!s.is_a?(Gem::Source) && s.version == version && s.default_gem?
end
else
ruby = pls.delete Gem::Platform::RUBY
platform_list = [ruby, *pls.sort].compact
"#{version} #{platform_list.join ' '}"
out = "default: #{out}" if default
end

if pls != [Gem::Platform::RUBY] then
platform_list = [pls.delete(Gem::Platform::RUBY), *pls.sort].compact
out = platform_list.unshift(out).join(' ')
end

out
end
end

Expand Down

0 comments on commit 63fcab8

Please sign in to comment.