Module: RSpecSystem::Log
Overview
This log overlay module, provides access to the log
method.
Defined Under Namespace
Classes: Logger, NullStream
Instance Method Summary
collapse
Instance Method Details
#bold(text) ⇒ Object
66
67
68
69
70
71
72
|
# File 'lib/rspec-system/log.rb', line 66
def bold(text)
begin
formatter.send(:bold, text)
rescue NameError
""
end
end
|
#color(text, color) ⇒ Object
74
75
76
77
78
79
80
|
# File 'lib/rspec-system/log.rb', line 74
def color(text, color)
begin
formatter.send(:color, text, color)
rescue NameError
""
end
end
|
46
47
48
49
50
51
52
|
# File 'lib/rspec-system/log.rb', line 46
def formatter
RSpec.configuration.formatters.each do |f|
if f.is_a? RSpecSystem::Formatter then
return f
end
end
end
|
Return the default Logger object.
40
41
42
43
44
|
# File 'lib/rspec-system/log.rb', line 40
def log
return @logger if @logger
@logger = Logger.new(output)
@logger
end
|
#output ⇒ Object
58
59
60
61
62
63
64
|
# File 'lib/rspec-system/log.rb', line 58
def output
begin
formatter.output
rescue NameError
NullStream.new
end
end
|