Class: ParallelSpecs::RSpec::LoggerBase
- Inherits:
-
RSpec::Core::Formatters::BaseTextFormatter
- Object
- RSpec::Core::Formatters::BaseTextFormatter
- ParallelSpecs::RSpec::LoggerBase
- Defined in:
- lib/parallel_specs/rspec/logger_base.rb
Direct Known Subclasses
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(*args) ⇒ LoggerBase
constructor
A new instance of LoggerBase.
Constructor Details
#initialize(*args) ⇒ LoggerBase
Returns a new instance of LoggerBase.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/parallel_specs/rspec/logger_base.rb', line 13 def initialize(*args) super @output ||= args[0] case @output when String FileUtils.mkdir_p(File.dirname(@output)) File.open(@output, 'w') {} @output = File.open(@output, 'a') when File @output.close @output = File.open(@output.path, 'a') end end |
Instance Method Details
#close ⇒ Object
28 29 30 |
# File 'lib/parallel_specs/rspec/logger_base.rb', line 28 def close(*) @output.close if IO === @output && @output != $stdout end |