diff options
author | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-01 03:45:05 +0000 |
---|---|---|
committer | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-01 03:45:05 +0000 |
commit | d22130922e7842226d38d59680e4bbb48a28a5f0 (patch) | |
tree | 39594d3a14641dd5488a99a5e633239296fa5742 /lib/rubygems/commands/specification_command.rb | |
parent | 4752539e3f3e563d559732c52424206bd6f12dbd (diff) |
Import rubygems 1.8.5 (released @ 137c80f)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands/specification_command.rb')
-rw-r--r-- | lib/rubygems/commands/specification_command.rb | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/lib/rubygems/commands/specification_command.rb b/lib/rubygems/commands/specification_command.rb index 987e401042..e4036aea78 100644 --- a/lib/rubygems/commands/specification_command.rb +++ b/lib/rubygems/commands/specification_command.rb @@ -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 - |