Sha256: 9745e695c1cf22b61ded818879e7d0b656c8c71788015b2dbe63002a262ed98a
Contents?: true
Size: 841 Bytes
Versions: 6
Compression:
Stored size: 841 Bytes
Contents
# Parse command-line arguments and run application. class SmallCage::Application require 'English' @signal_handlers = nil def self.init_signal_handlers @signal_handlers = { 'INT' => [], 'TERM' => [] } @signal_handlers.keys.each do |signal| Signal.trap(signal) do @signal_handlers[signal].each do |proc| proc.call(signal) end end end end def self.add_signal_handler(signal, handler) init_signal_handlers if @signal_handlers.nil? signal.to_a.each do |s| @signal_handlers[s] << handler end end def self.execute STDOUT.sync = true new.execute end def execute(argv = ARGV) options = parse_options(argv) SmallCage::Runner.run(options) end def parse_options(argv) SmallCage::OptionsParser.new(argv).parse end end
Version data entries
6 entries across 6 versions & 1 rubygems