mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Import rubygems 1.8.5 (released @ 137c80f)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4752539e3f
commit
d22130922e
103 changed files with 4890 additions and 3599 deletions
|
@ -80,10 +80,12 @@ class Gem::Commands::QueryCommand < Gem::Command
|
|||
exit_code |= 1
|
||||
end
|
||||
|
||||
raise Gem::SystemExitException, exit_code
|
||||
terminate_interaction exit_code
|
||||
end
|
||||
|
||||
dep = Gem::Dependency.new name, Gem::Requirement.default
|
||||
req = Gem::Requirement.default
|
||||
# TODO: deprecate for real
|
||||
dep = Deprecate.skip_during { Gem::Dependency.new name, req }
|
||||
|
||||
if local? then
|
||||
if prerelease and not both? then
|
||||
|
@ -96,7 +98,9 @@ class Gem::Commands::QueryCommand < Gem::Command
|
|||
say
|
||||
end
|
||||
|
||||
specs = Gem.source_index.search dep
|
||||
specs = Gem::Specification.find_all { |s|
|
||||
s.name =~ name and req =~ s.version
|
||||
}
|
||||
|
||||
spec_tuples = specs.map do |spec|
|
||||
[[spec.name, spec.version, spec.original_platform, spec], :local]
|
||||
|
@ -129,9 +133,8 @@ class Gem::Commands::QueryCommand < Gem::Command
|
|||
##
|
||||
# Check if gem +name+ version +version+ is installed.
|
||||
|
||||
def installed?(name, version = Gem::Requirement.default)
|
||||
dep = Gem::Dependency.new name, version
|
||||
!Gem.source_index.search(dep).empty?
|
||||
def installed?(name, req = Gem::Requirement.default)
|
||||
Gem::Specification.any? { |s| s.name =~ name and req =~ s.version }
|
||||
end
|
||||
|
||||
def output_query_results(spec_tuples)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue