Class: Beez::CLI

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/beez/cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#launcherObject

Returns the value of attribute launcher.



13
14
15
# File 'lib/beez/cli.rb', line 13

def launcher
  @launcher
end

Instance Method Details

#parse(argv = ARGV) ⇒ Object



15
16
17
# File 'lib/beez/cli.rb', line 15

def parse(argv = ARGV)
  parse_options(argv)
end

#runObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/beez/cli.rb', line 19

def run
  boot

  self_read, self_write = IO.pipe
  sigs = %w[INT TERM]
  sigs.each do |sig|
    trap sig do
      self_write.write("#{sig}\n")
    end
  rescue ArgumentError
    logger.warn "Signal #{sig} not supported"
  end

  launch(self_read)
end