Class: ExtractExifGps::Cli

Inherits:
Thor
  • Object
show all
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: options[:recursive])
  )

  $stdout.reopen(options[:output], 'w') if options[: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: options[:recursive])
  )

  template = options[:template] || template_path('templates/basic.html.erb')

  $stdout.reopen(options[:output], 'w') if options[:output]
  puts HtmlRenderer.new(extractor,
                        search_paths: search_paths,
                        template: template)
end