Class: Harmoniser::CLI

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

Defined Under Namespace

Classes: SigUsr1

Constant Summary collapse

SIGNAL_HANDLERS =
{
  "INT" => lambda { |cli, signal| raise Interrupt },
  "TERM" => lambda { |cli, signal| raise Interrupt },
  "USR1" => lambda { |cli, signal| raise SigUsr1 }
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



20
21
22
23
# File 'lib/harmoniser/cli.rb', line 20

def initialize
  @configuration = Harmoniser.default_configuration
  @logger = Harmoniser.logger
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



18
19
20
# File 'lib/harmoniser/cli.rb', line 18

def logger
  @logger
end

Instance Method Details

#callObject



25
26
27
28
29
# File 'lib/harmoniser/cli.rb', line 25

def call
  parse_options
  @launcher = Launcher.call(configuration: @configuration, logger: @logger)
  run
end