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