Class: Diligent::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/diligent/cli.rb

Instance Method Summary collapse

Instance Method Details

#legaleseObject



7
8
9
# File 'lib/diligent/cli.rb', line 7

def legalese
  puts Diligent::Info.legalese
end

#listObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/diligent/cli.rb', line 14

def list
  list = Diligent::List.new

  case (options[:format] || 'json')
  when 'csv'
    list.as_csv(options[:outfile] || './diligent.csv')
  when 'json'
    puts list.as_json(options[:outfile] || nil)
  when 'html'
    list.as_html(options[:outfile] || './diligent.html')
  else
    raise 'Only CSV, HTML and JSON are currently supported.'
  end
end