Class: Magellan::Logger
- Inherits:
-
Object
- Object
- Magellan::Logger
- Defined in:
- lib/magellan/logger.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(file_name = nil) ⇒ Logger
constructor
:nodoc:.
-
#update(time, passed, message) ⇒ Object
:nodoc:.
Constructor Details
#initialize(file_name = nil) ⇒ Logger
:nodoc:
4 5 6 7 |
# File 'lib/magellan/logger.rb', line 4 def initialize(file_name=nil) # :nodoc: @file_name = file_name File.open(@file_name, 'a') {} if @file_name end |
Instance Method Details
#update(time, passed, message) ⇒ Object
:nodoc:
9 10 11 12 13 |
# File 'lib/magellan/logger.rb', line 9 def update(time,passed,) # :nodoc: $stdout.putc(passed ? '.' : 'F') $stdout.flush File.open(@file_name, 'a') {|f| f.write( + "\n") } if @file_name && !passed end |