Class: Orbacle::CommandLineInterface

Inherits:
Object
  • Object
show all
Defined in:
lib/orbacle/command_line_interface.rb

Defined Under Namespace

Classes: Options

Instance Method Summary collapse

Instance Method Details

#call(args) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/orbacle/command_line_interface.rb', line 47

def call(args)
  options = Options.new
  OptionParser.new do |parser|
    options.define_options(parser)
  end.parse!(args)
  call_command(args[0], options)
end

#call_command(command, options) ⇒ Object



55
56
57
58
59
60
61
62
# File 'lib/orbacle/command_line_interface.rb', line 55

def call_command(command, options)
  case command
  when 'index' then index(options)
  when 'file-server' then file_server(options)
  when 'generate-datajs' then generate_datajs(options)
  else no_command
  end
end