Class: Rutema::Reporters::Console
- Inherits:
-
EventReporter
- Object
- EventReporter
- Rutema::Reporters::Console
- Defined in:
- lib/rutema/core/reporter.rb
Overview
A very simple event reporter that outputs to the console
It has three settings: off, normal and verbose.
Example configuration: cfg.reporter="mode"=>"verbose"
Instance Method Summary collapse
-
#initialize(configuration, dispatcher) ⇒ Console
constructor
A new instance of Console.
-
#update(message) ⇒ Object
rubocop:disable Metrics/CyclomaticComplexity.
Methods inherited from EventReporter
Constructor Details
#initialize(configuration, dispatcher) ⇒ Console
Returns a new instance of Console.
108 109 110 111 |
# File 'lib/rutema/core/reporter.rb', line 108 def initialize(configuration, dispatcher) super @mode = configuration.reporters.fetch(self.class, {})["mode"] end |
Instance Method Details
#update(message) ⇒ Object
rubocop:disable Metrics/CyclomaticComplexity
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/rutema/core/reporter.rb', line 114 def update() return if @mode == "off" case when RunnerMessage if .status == :error puts "FATAL|#{}" elsif .status == :warning puts "WARNING|#{}" elsif @mode == "verbose" puts "#{} #{.status}." end when ErrorMessage puts when Message puts if @mode == "verbose" end end |