summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/commands')
-rw-r--r--lib/rubygems/commands/dependency_command.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/rubygems/commands/dependency_command.rb b/lib/rubygems/commands/dependency_command.rb
index 8fae87c90f..44b269bb11 100644
--- a/lib/rubygems/commands/dependency_command.rb
+++ b/lib/rubygems/commands/dependency_command.rb
@@ -43,14 +43,21 @@ class Gem::Commands::DependencyCommand < Gem::Command
end
def execute
- options[:args] << '.' if options[:args].empty?
+ options[:args] << '' if options[:args].empty?
specs = {}
source_indexes = Hash.new do |h, source_uri|
h[source_uri] = Gem::SourceIndex.new
end
- pattern = /\A#{Regexp.union(*options[:args])}/
+ pattern = if options[:args].length == 1 and
+ options[:args].first =~ /\A\/(.*)\/(i)?\z/m then
+ flags = $2 ? Regexp::IGNORECASE : nil
+ Regexp.new $1, flags
+ else
+ /\A#{Regexp.union(*options[:args])}/
+ end
+
dependency = Gem::Dependency.new pattern, options[:version]
if options[:reverse_dependencies] and remote? and not local? then