Class: Ankit::ListCommand
- Includes:
- CardNaming
- Defined in:
- lib/ankit/list_command.rb
Constant Summary
Constants inherited from Command
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
Methods included from CardNaming
#card_wildcard_for, #to_card_name, #to_card_path
Methods inherited from Command
available, by_name, command_name, define_options, #initialize, option_spec
Constructor Details
This class inherits a constructor from Ankit::Command
Instance Method Details
#each_card(&block) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/ankit/list_command.rb', line 14 def each_card(&block) runtime.config.card_search_paths.each do |p| Dir.glob(card_wildcard_for(p)).each do |f| block.call(f) end end end |
#each_card_name(&block) ⇒ Object
22 23 24 |
# File 'lib/ankit/list_command.rb', line 22 def each_card_name(&block) each_card { |path| block.call(to_card_name(path)) } end |
#execute ⇒ Object
10 11 12 |
# File 'lib/ankit/list_command.rb', line 10 def execute() each_card { |f| runtime.stdout.print("#{f}\n") } end |