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-01 11:14:04 +09:00
|
|
|
require 'rubygems/query_utils'
|
2007-11-10 07:48:56 +00:00
|
|
|
|
2008-06-17 22:04:18 +00:00
|
|
|
##
|
2020-02-01 11:14:04 +09:00
|
|
|
# Searches for gems starting with the supplied argument.
|
2008-06-17 22:04:18 +00:00
|
|
|
|
2020-02-01 11:14:04 +09:00
|
|
|
class Gem::Commands::ListCommand < Gem::Command
|
|
|
|
include Gem::QueryUtils
|
2008-06-17 22:04:18 +00:00
|
|
|
|
2013-07-08 22:41:03 +00:00
|
|
|
def initialize
|
2020-02-01 11:14:04 +09:00
|
|
|
super 'list', 'Display local gems whose name matches REGEXP',
|
|
|
|
:name => //, :domain => :local, :details => false, :versions => true,
|
|
|
|
:installed => nil, :version => Gem::Requirement.default
|
2008-06-17 22:04:18 +00:00
|
|
|
|
2020-02-01 11:14:04 +09:00
|
|
|
add_query_options
|
2008-06-17 22:04:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def arguments # :nodoc:
|
2014-09-14 03:30:02 +00:00
|
|
|
"REGEXP regexp to look for in gem name"
|
2008-06-17 22:04:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def defaults_str # :nodoc:
|
|
|
|
"--local --no-details"
|
2007-11-10 07:48:56 +00:00
|
|
|
end
|
2008-06-17 22:04:18 +00:00
|
|
|
|
2013-09-14 08:59:02 +00:00
|
|
|
def description # :nodoc:
|
|
|
|
<<-EOF
|
|
|
|
The list command is used to view the gems you have installed locally.
|
|
|
|
|
|
|
|
The --details option displays additional details including the summary, the
|
|
|
|
homepage, the author, the locations of different versions of the gem.
|
|
|
|
|
|
|
|
To search for remote gems use the search command.
|
|
|
|
EOF
|
|
|
|
end
|
|
|
|
|
2008-06-17 22:04:18 +00:00
|
|
|
def usage # :nodoc:
|
2015-07-01 21:50:14 +00:00
|
|
|
"#{program_name} [REGEXP ...]"
|
2008-06-17 22:04:18 +00:00
|
|
|
end
|
2007-11-10 07:48:56 +00:00
|
|
|
end
|