Class: Simplabs::Excellent::Formatters::Text
- Defined in:
- lib/simplabs/excellent/formatters/text.rb
Overview
:nodoc:
Instance Method Summary collapse
- #end ⇒ Object
- #file(filename) {|_self| ... } ⇒ Object
-
#initialize(stream = $stdout) ⇒ Text
constructor
A new instance of Text.
- #start ⇒ Object
- #warning(warning) ⇒ Object
Constructor Details
#initialize(stream = $stdout) ⇒ Text
Returns a new instance of Text.
11 12 13 14 |
# File 'lib/simplabs/excellent/formatters/text.rb', line 11 def initialize(stream = $stdout) super @total_warnings = 0 end |
Instance Method Details
#end ⇒ Object
30 31 32 |
# File 'lib/simplabs/excellent/formatters/text.rb', line 30 def end @stream.puts "\n Found #{@total_warnings} warnings.\n\n" end |
#file(filename) {|_self| ... } ⇒ Object
20 21 22 23 |
# File 'lib/simplabs/excellent/formatters/text.rb', line 20 def file(filename) @stream.puts "\n #{filename}\n" yield self end |
#start ⇒ Object
16 17 18 |
# File 'lib/simplabs/excellent/formatters/text.rb', line 16 def start @stream.puts "\n Excellent result:\n" end |
#warning(warning) ⇒ Object
25 26 27 28 |
# File 'lib/simplabs/excellent/formatters/text.rb', line 25 def warning(warning) @stream.puts " * Line #{warning.line_number.to_s.lpad(3)}: \e[33m#{warning.}\e[0m" @total_warnings += 1 end |