Class: Cloudmunda::CLI

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#launcherObject

Returns the value of attribute launcher.



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

def launcher
  @launcher
end

Instance Method Details

#parse(argv = ARGV) ⇒ Object



17
18
19
# File 'lib/cloudmunda/cli.rb', line 17

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

#runObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/cloudmunda/cli.rb', line 21

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