summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-25 15:42:22 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-25 15:42:22 +0000
commit589da706be0b7abcbcf54e6f8c979c94ea174b09 (patch)
tree43da9a5cb9c4c690a2f02209979dd7f739c8980c /lib/rubygems/commands
parent7567977adc82ec528f4f0e5c650a940304e84b34 (diff)
* lib/rubygems: Update to RubyGems 2.0.6. [ruby-core:56160]
[Backport #8682] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands')
-rw-r--r--lib/rubygems/commands/query_command.rb17
-rw-r--r--lib/rubygems/commands/search_command.rb2
2 files changed, 13 insertions, 6 deletions
diff --git a/lib/rubygems/commands/query_command.rb b/lib/rubygems/commands/query_command.rb
index 7bda7383e2..05b214bb63 100644
--- a/lib/rubygems/commands/query_command.rb
+++ b/lib/rubygems/commands/query_command.rb
@@ -14,7 +14,7 @@ class Gem::Commands::QueryCommand < Gem::Command
summary = 'Query gem information in local or remote repositories')
super name, summary,
:name => //, :domain => :local, :details => false, :versions => true,
- :installed => false, :version => Gem::Requirement.default
+ :installed => nil, :version => Gem::Requirement.default
add_option('-i', '--[no-]installed',
'Check for installed gem') do |value, options|
@@ -67,15 +67,20 @@ class Gem::Commands::QueryCommand < Gem::Command
name = options[:name]
prerelease = options[:prerelease]
- if options[:installed] then
+ unless options[:installed].nil? then
if name.source.empty? then
alert_error "You must specify a gem name"
exit_code |= 4
- elsif installed? name, options[:version] then
- say "true"
else
- say "false"
- exit_code |= 1
+ installed = installed? name, options[:version]
+ installed = !installed unless options[:installed]
+
+ if installed then
+ say "true"
+ else
+ say "false"
+ exit_code |= 1
+ end
end
terminate_interaction exit_code
diff --git a/lib/rubygems/commands/search_command.rb b/lib/rubygems/commands/search_command.rb
index 7810c85b36..c125715fe2 100644
--- a/lib/rubygems/commands/search_command.rb
+++ b/lib/rubygems/commands/search_command.rb
@@ -7,6 +7,8 @@ class Gem::Commands::SearchCommand < Gem::Commands::QueryCommand
super 'search', 'Display all gems whose name contains STRING'
remove_option '--name-matches'
+
+ defaults[:domain] = :remote
end
def arguments # :nodoc: