Module: SassProf::Reporter
Instance Attribute Summary collapse
-
#rows ⇒ Object
Returns the value of attribute rows.
Instance Method Summary collapse
Instance Attribute Details
#rows ⇒ Object
Returns the value of attribute rows.
3 4 5 |
# File 'lib/sass-prof/reporter.rb', line 3 def rows @rows end |
Instance Method Details
#add_row(row) ⇒ Object
7 8 9 10 |
# File 'lib/sass-prof/reporter.rb', line 7 def add_row(row) row = Formatter.truncate_row row if Config.max_width @rows << row end |
#log_report ⇒ Object
21 22 23 24 25 26 |
# File 'lib/sass-prof/reporter.rb', line 21 def log_report File.open(Config.output_file, "a+") do |f| f.puts Formatter.to_table @rows.map { |r| r.map { |col| col.gsub Formatter::REGEX_ASCII, "" } } end end |
#print_report ⇒ Object
16 17 18 19 |
# File 'lib/sass-prof/reporter.rb', line 16 def print_report log_report if Config.output_file puts Formatter.to_table @rows unless Config.quiet end |
#reset_report ⇒ Object
12 13 14 |
# File 'lib/sass-prof/reporter.rb', line 12 def reset_report @rows = [] end |