Class: GCOV::ANSIIFormatter
- Inherits:
-
Object
- Object
- GCOV::ANSIIFormatter
- Defined in:
- lib/ansii_formatter.rb
Instance Method Summary collapse
-
#initialize(project) ⇒ ANSIIFormatter
constructor
A new instance of ANSIIFormatter.
- #print ⇒ Object
Constructor Details
#initialize(project) ⇒ ANSIIFormatter
Returns a new instance of ANSIIFormatter.
12 13 14 |
# File 'lib/ansii_formatter.rb', line 12 def initialize project @project = project end |
Instance Method Details
#print ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ansii_formatter.rb', line 16 def print @project.files.each do |file| puts "#{white}#{bold}=== #{file.['Source']} ===#{reset}" file.lines.select{|line| line.number > 0}.each do |line| col = case line.count when :none then dark+white when :missed then black+on_red else green end puts col + line.text + reset end end end |