Class: Diligent::CLI
- Inherits:
-
Thor
- Object
- Thor
- Diligent::CLI
- Defined in:
- lib/diligent/cli.rb
Instance Method Summary collapse
Instance Method Details
#legalese ⇒ Object
7 8 9 |
# File 'lib/diligent/cli.rb', line 7 def legalese puts Diligent::Info.legalese end |
#list ⇒ Object
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 ([:format] || 'json') when 'csv' list.as_csv([:outfile] || './diligent.csv') when 'json' puts list.as_json([:outfile] || nil) when 'html' list.as_html([:outfile] || './diligent.html') else raise 'Only CSV, HTML and JSON are currently supported.' end end |