Class: Rutema::App

Inherits:
Object
  • Object
show all
Defined in:
lib/rutema/application.rb

Overview

Entry-point class for rutema

This class parses the commandline, sets up the internal configuration of rutema accordingly and starts the application flow.

Instance Method Summary collapse

Constructor Details

#initialize(command_line_args) ⇒ App

Configure and start the application flow according to the passed commandline options



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/rutema/application.rb', line 18

def initialize(command_line_args)
  parse_command_line(command_line_args)
  @configuration = Rutema::Configuration.new(@config_file)
  @configuration.context ||= {}
  @configuration.context[:config_file] = File.expand_path(@config_file)
  @configuration.context[:config_name] = File.basename(@config_file)
  @configuration.context[:start_time] = Time.now
  @configuration.reporters ||= {}
  @configuration.reporters[Rutema::Reporters::Console] ||= { :class => Rutema::Reporters::Console, "silent" => @silent } unless @bare
  @configuration.reporters[Rutema::Reporters::Summary] ||= { :class => Rutema::Reporters::Summary, "silent" => @silent || @bare }
  @engine = Rutema::Engine.new(@configuration)
  application_flow
end