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
|
@ -72,18 +72,8 @@ FIELD name of gemspec field to show
|
|||
|
||||
field = get_one_optional_argument
|
||||
|
||||
if field then
|
||||
field = field.intern
|
||||
|
||||
if options[:format] == :ruby then
|
||||
raise Gem::CommandLineError, "--ruby and FIELD are mutually exclusive"
|
||||
end
|
||||
|
||||
unless Gem::Specification.attribute_names.include? field then
|
||||
raise Gem::CommandLineError,
|
||||
"no field %p on Gem::Specification" % field.to_s
|
||||
end
|
||||
end
|
||||
raise Gem::CommandLineError, "--ruby and FIELD are mutually exclusive" if
|
||||
field and options[:format] == :ruby
|
||||
|
||||
if local? then
|
||||
if File.exist? gem then
|
||||
|
@ -91,7 +81,7 @@ FIELD name of gemspec field to show
|
|||
end
|
||||
|
||||
if specs.empty? then
|
||||
specs.push(*Gem.source_index.search(dep))
|
||||
specs.push(*dep.matching_specs)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -106,7 +96,11 @@ FIELD name of gemspec field to show
|
|||
terminate_interaction 1
|
||||
end
|
||||
|
||||
output = lambda do |s|
|
||||
unless options[:all] then
|
||||
specs = [specs.sort_by { |s| s.version }.last]
|
||||
end
|
||||
|
||||
specs.each do |s|
|
||||
s = s.send field if field
|
||||
|
||||
say case options[:format]
|
||||
|
@ -117,14 +111,5 @@ FIELD name of gemspec field to show
|
|||
|
||||
say "\n"
|
||||
end
|
||||
|
||||
if options[:all] then
|
||||
specs.each(&output)
|
||||
else
|
||||
spec = specs.sort_by { |s| s.version }.last
|
||||
output[spec]
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue