Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ lib/rubygems/commands/outdated_command.rb
lib/rubygems/commands/owner_command.rb
lib/rubygems/commands/pristine_command.rb
lib/rubygems/commands/push_command.rb
lib/rubygems/commands/query_command.rb
lib/rubygems/commands/rdoc_command.rb
lib/rubygems/commands/search_command.rb
lib/rubygems/commands/server_command.rb
Expand Down Expand Up @@ -598,6 +599,7 @@ test/rubygems/test_gem_commands_outdated_command.rb
test/rubygems/test_gem_commands_owner_command.rb
test/rubygems/test_gem_commands_pristine_command.rb
test/rubygems/test_gem_commands_push_command.rb
test/rubygems/test_gem_commands_query_command.rb
test/rubygems/test_gem_commands_search_command.rb
test/rubygems/test_gem_commands_server_command.rb
test/rubygems/test_gem_commands_setup_command.rb
Expand Down
28 changes: 28 additions & 0 deletions lib/rubygems/commands/query_command.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/query_utils'
require 'rubygems/deprecate'

class Gem::Commands::QueryCommand < Gem::Command

extend Gem::Deprecate
deprecate_command(2020, 12)

include Gem::QueryUtils

def initialize(name = 'query',
summary = 'Query gem information in local or remote repositories')
super name, summary,
:name => //, :domain => :local, :details => false, :versions => true,
:installed => nil, :version => Gem::Requirement.default

add_option('-n', '--name-matches REGEXP',
'Name of gem(s) to query on matches the',
'provided REGEXP') do |value, options|
options[:name] = /#{value}/i
end

add_query_options
end

end
Loading