Class: ExtractExifGps::Cli
- Inherits:
-
Thor
- Object
- Thor
- ExtractExifGps::Cli
- Defined in:
- lib/cli.rb
Overview
Defines the CLI interface for this application.
You can get information about command-line options with extractexifgps help or extractexifgps help <command> to information pertaining to the particular command.
Instance Method Summary collapse
Instance Method Details
#csv(*dirs) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/cli.rb', line 25 def csv(*dirs) extractor = ExtractExifGps::GpsExtractor.new( FileSet.new(dirs.empty? ? ['.'] : dirs, recursive: [:recursive]) ) $stdout.reopen([:output], 'w') if [:output] puts CsvRenderer.new(extractor) end |
#html(*dirs) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/cli.rb', line 38 def html(*dirs) search_paths = dirs.empty? ? ['.'] : dirs extractor = ExtractExifGps::GpsExtractor.new( FileSet.new(search_paths, recursive: [:recursive]) ) template = [:template] || template_path('templates/basic.html.erb') $stdout.reopen([:output], 'w') if [:output] puts HtmlRenderer.new(extractor, search_paths: search_paths, template: template) end |