Class: Ruote::WaitLogger
- Inherits:
-
TestLogger
- Object
- TestLogger
- Ruote::WaitLogger
- Defined in:
- lib/ruote/log/wait_logger.rb
Overview
A helper logger for quickstart examples.
Keeps a maximum of 147 messages.
Instance Attribute Summary collapse
-
#noisy ⇒ Object
Returns the value of attribute noisy.
Attributes inherited from TestLogger
Instance Method Summary collapse
-
#initialize(context) ⇒ WaitLogger
constructor
A new instance of WaitLogger.
- #notify(msg) ⇒ Object
Methods inherited from TestLogger
Constructor Details
#initialize(context) ⇒ WaitLogger
Returns a new instance of WaitLogger.
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/ruote/log/wait_logger.rb', line 39 def initialize(context) @context = context @color = 33 @context.worker.subscribe(:all, self) if @context.worker @noisy = false @count = -1 @seen = [] @waiting = [] end |
Instance Attribute Details
#noisy ⇒ Object
Returns the value of attribute noisy.
37 38 39 |
# File 'lib/ruote/log/wait_logger.rb', line 37 def noisy @noisy end |
Instance Method Details
#notify(msg) ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'lib/ruote/log/wait_logger.rb', line 53 def notify(msg) puts(pretty_print(msg)) if @noisy @seen << msg if msg['action'] != 'noop' @seen.shift if @seen.size > 147 check_waiting end |