Class: Gem::Commands::AgCommand
- Inherits:
-
Gem::Command
- Object
- Gem::Command
- Gem::Commands::AgCommand
- Defined in:
- lib/rubygems/commands/ag_command.rb
Instance Method Summary collapse
- #arguments ⇒ Object
- #execute ⇒ Object
-
#initialize ⇒ AgCommand
constructor
A new instance of AgCommand.
- #usage ⇒ Object
Constructor Details
#initialize ⇒ AgCommand
Returns a new instance of AgCommand.
4 5 6 7 8 |
# File 'lib/rubygems/commands/ag_command.rb', line 4 def initialize super 'ag', "Search for PATTERN in installed gem source using 'ag'" add_ag_opts possible_ag_opts end |
Instance Method Details
#arguments ⇒ Object
10 11 12 |
# File 'lib/rubygems/commands/ag_command.rb', line 10 def arguments "PATTERN Search Pattern" end |
#execute ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/rubygems/commands/ag_command.rb', line 18 def execute search_term, gems_to_search = [:args] gems_to_search = Array(gems_to_search).compact paths = search_paths(gems_to_search) flags = ag_flags execute_ag flags, search_term, paths end |
#usage ⇒ Object
14 15 16 |
# File 'lib/rubygems/commands/ag_command.rb', line 14 def usage "#{program_name} PATTERN [GEMNAME ...]" end |