Module: Enginevib::Launcher

Included in:
Main
Defined in:
lib/enginevib/launcher.rb

Overview

Defines the Launcher module which must be defined in Main.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



5
6
7
# File 'lib/enginevib/launcher.rb', line 5

def options
  @options
end

Instance Method Details

#launchObject



7
8
9
10
11
# File 'lib/enginevib/launcher.rb', line 7

def launch
  start_scheduler
rescue SystemExit, Interrupt
  puts 'Good bye!' # May not be printed since we are using curses.
end

#parse_argumentsObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/enginevib/launcher.rb', line 13

def parse_arguments
  @options = {
    simulation_mode: true,
    serial_port: nil
  }
  OptionParser.new do |opts|
    opts.banner = 'Usage: enginevib [options]'
    on_simulation_mode(opts)
    on_serial_port(opts)
    on_help(opts)
  end.parse!
end