Class: RubyRunHTMLWriter::RubyRunHTMLDevice

Inherits:
Logger::LogDevice
  • Object
show all
Defined in:
lib/rubyrun/rubyrun_html_writer__.rb

Instance Method Summary collapse

Constructor Details

#initialize(log = nil, header = nil, opt = {}) ⇒ RubyRunHTMLDevice

Returns a new instance of RubyRunHTMLDevice.



55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/rubyrun/rubyrun_html_writer__.rb', line 55

def initialize(log = nil, header = nil, opt = {})
  @header = header
  @dev = @filename = @shift_age = @shift_size = nil
  @mutex = LogDeviceMutex.new
  if log.respond_to?(:write) and log.respond_to?(:close)
    @dev = log
  else
    @dev = open_logfile(log)
    @dev.sync = true
    @filename = log
    @shift_age = opt[:shift_age] || 7
    @shift_size = opt[:shift_size] || 1048576
  end
end