Module: SassProf::Reporter

Extended by:
Reporter
Included in:
Reporter
Defined in:
lib/sass-prof/reporter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#rowsObject

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_reportObject



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


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_reportObject



12
13
14
# File 'lib/sass-prof/reporter.rb', line 12

def reset_report
  @rows = []
end