Class: Quata::CommandLine

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/quata/command_line.rb

Overview

Handles the command line interface

Instance Method Summary collapse

Instance Method Details

#execute(argv = []) ⇒ Object

Gets an array of arguments (e.g. ARGV), executes the command if valid and shows usage patterns / help otherwise.



14
15
16
17
18
19
20
21
22
# File 'lib/quata/command_line.rb', line 14

def execute(argv=[])
  doc = File.read File.dirname(__FILE__) + '/docopt.txt'
  begin
    args = Docopt::docopt(doc, argv: argv, version: VERSION)
    handle args
  rescue Docopt::Exit => e
    puts e.message
  end
end

#quandlObject



24
25
26
# File 'lib/quata/command_line.rb', line 24

def quandl
  @quandl ||= quandl!
end