Class: Snippit::CLI::List
- Inherits:
-
Object
- Object
- Snippit::CLI::List
- Includes:
- IO
- Defined in:
- lib/snippit/cli/list.rb
Overview
Snippit::CLI::List lists all snippets.
Instance Method Summary collapse
-
#start ⇒ Integer
Starts the list subcommand.
Methods included from IO
#definitions, #definitions_file, #delete_snippet, #filepath!, #read_snippet, #snippit_dir, #snippit_dir!, #write_definition, #write_snippet
Instance Method Details
#start ⇒ Integer
Starts the list subcommand.
14 15 16 17 18 19 20 21 |
# File 'lib/snippit/cli/list.rb', line 14 def start out = definitions.map { |slug, name| "#{slug}: #{name}" } puts 'No snippets found.' if out.empty? puts out 0 end |