summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands/specification_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/commands/specification_command.rb')
-rw-r--r--lib/rubygems/commands/specification_command.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rubygems/commands/specification_command.rb b/lib/rubygems/commands/specification_command.rb
index 689f2560c9..5aaf6d1797 100644
--- a/lib/rubygems/commands/specification_command.rb
+++ b/lib/rubygems/commands/specification_command.rb
@@ -40,6 +40,7 @@ class Gem::Commands::SpecificationCommand < Gem::Command
def execute
specs = []
gem = get_one_gem_name
+ dep = Gem::Dependency.new gem, options[:version]
if local? then
if File.exist? gem then
@@ -47,12 +48,11 @@ class Gem::Commands::SpecificationCommand < Gem::Command
end
if specs.empty? then
- specs.push(*Gem.source_index.search(/\A#{gem}\z/, options[:version]))
+ specs.push(*Gem.source_index.search(dep))
end
end
if remote? then
- dep = Gem::Dependency.new gem, options[:version]
found = Gem::SpecFetcher.fetcher.fetch dep
specs.push(*found.map { |spec,| spec })