2016-02-01 07:43:26 -05:00
|
|
|
# frozen_string_literal: true
|
2019-04-22 07:56:16 -04:00
|
|
|
require_relative "../command"
|
|
|
|
require_relative "../query_utils"
|
2007-11-10 02:48:56 -05:00
|
|
|
|
2008-06-17 18:04:18 -04:00
|
|
|
##
|
2020-01-31 21:14:04 -05:00
|
|
|
# Searches for gems starting with the supplied argument.
|
2008-06-17 18:04:18 -04:00
|
|
|
|
2020-01-31 21:14:04 -05:00
|
|
|
class Gem::Commands::ListCommand < Gem::Command
|
|
|
|
include Gem::QueryUtils
|
2008-06-17 18:04:18 -04:00
|
|
|
|
2013-07-08 18:41:03 -04:00
|
|
|
def initialize
|
2020-01-31 21:14:04 -05:00
|
|
|
super "list", "Display local gems whose name matches REGEXP",
|
2022-01-17 08:10:27 -05:00
|
|
|
:domain => :local, :details => false, :versions => true,
|
2020-01-31 21:14:04 -05:00
|
|
|
:installed => nil, :version => Gem::Requirement.default
|
2008-06-17 18:04:18 -04:00
|
|
|
|
2020-01-31 21:14:04 -05:00
|
|
|
add_query_options
|
2008-06-17 18:04:18 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def arguments # :nodoc:
|
2014-09-13 23:30:02 -04:00
|
|
|
"REGEXP regexp to look for in gem name"
|
2008-06-17 18:04:18 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def defaults_str # :nodoc:
|
|
|
|
"--local --no-details"
|
2007-11-10 02:48:56 -05:00
|
|
|
end
|
2008-06-17 18:04:18 -04:00
|
|
|
|
2013-09-14 04:59:02 -04: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 18:04:18 -04:00
|
|
|
def usage # :nodoc:
|
2015-07-01 17:50:14 -04:00
|
|
|
"#{program_name} [REGEXP ...]"
|
2008-06-17 18:04:18 -04:00
|
|
|
end
|
2007-11-10 02:48:56 -05:00
|
|
|
end
|