lib/ruote/log/wait_logger.rb in ruote-2.1.11 vs lib/ruote/log/wait_logger.rb in ruote-2.2.0

- old
+ new

@@ -1,7 +1,7 @@ #-- -# Copyright (c) 2005-2010, John Mettraux, jmettraux@gmail.com +# Copyright (c) 2005-2011, John Mettraux, jmettraux@gmail.com # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell @@ -28,15 +28,17 @@ module Ruote # # A helper logger for quickstart examples. # + # Keeps a maximum of 147 messages. + # class WaitLogger < TestLogger attr_accessor :noisy - def initialize (context) + def initialize(context) @context = context @color = 33 @context.worker.subscribe(:all, self) if @context.worker @@ -46,10 +48,10 @@ @seen = [] @waiting = [] end - def notify (msg) + def notify(msg) puts(pretty_print(msg)) if @noisy #return if @waiting.size < 1 #check_msg(msg)