2016-02-01 12:43:26 +00:00
|
|
|
# frozen_string_literal: true
|
2007-11-10 07:48:56 +00:00
|
|
|
require 'rubygems/command'
|
2020-02-06 21:54:23 +09:00
|
|
|
require 'rubygems/query_utils'
|
|
|
|
require 'rubygems/deprecate'
|
2007-11-10 07:48:56 +00:00
|
|
|
|
|
|
|
class Gem::Commands::QueryCommand < Gem::Command
|
2020-02-06 21:54:23 +09:00
|
|
|
extend Gem::Deprecate
|
2020-04-19 07:41:54 -06:00
|
|
|
rubygems_deprecate_command
|
2020-02-06 21:54:23 +09:00
|
|
|
|
|
|
|
include Gem::QueryUtils
|
2007-11-10 07:48:56 +00:00
|
|
|
|
|
|
|
def initialize(name = 'query',
|
|
|
|
summary = 'Query gem information in local or remote repositories')
|
|
|
|
super name, summary,
|
2008-03-31 22:40:06 +00:00
|
|
|
:name => //, :domain => :local, :details => false, :versions => true,
|
2013-07-22 22:46:50 +00:00
|
|
|
:installed => nil, :version => Gem::Requirement.default
|
2008-03-31 22:40:06 +00:00
|
|
|
|
2007-11-10 07:48:56 +00:00
|
|
|
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
|
|
|
|
|
2020-02-06 21:54:23 +09:00
|
|
|
add_query_options
|
2007-11-10 07:48:56 +00:00
|
|
|
end
|
|
|
|
end
|