Class: HTMLTokenCounterFormater

Inherits:
TokenCounterFormater show all
Includes:
HTMLStyleSheet
Defined in:
lib/saikuro.rb

Instance Attribute Summary

Attributes inherited from BaseFormater

#current, #errors, #warnings

Instance Method Summary collapse

Methods included from HTMLStyleSheet

style_sheet, #style_sheet

Methods inherited from BaseFormater

#initialize, #reset_data, #warn_error?

Constructor Details

This class inherits a constructor from BaseFormater

Instance Method Details

#endObject



794
795
796
# File 'lib/saikuro.rb', line 794

def end
  @out.puts "</body>\n</html>"
end

#end_countObject



791
792
# File 'lib/saikuro.rb', line 791

def end_count
end

#end_fileObject



787
788
789
# File 'lib/saikuro.rb', line 787

def end_file
  @out.puts "</table>"
end

#line_token_count(line_number, number_of_tokens) ⇒ Object



781
782
783
784
785
# File 'lib/saikuro.rb', line 781

def line_token_count(line_number,number_of_tokens)
  return if @filter.ignore?(number_of_tokens)
  klass = warn_error?(number_of_tokens, line_number)
  @out.puts "<tr><td>#{line_number}</td><td#{klass}>#{number_of_tokens}</td></tr>"
end

#start(new_out = nil) ⇒ Object



759
760
761
762
763
# File 'lib/saikuro.rb', line 759

def start(new_out=nil)
  reset_data
  @out = new_out if new_out
  @out.puts "<html>#{style_sheet}<body>"
end

#start_count(number_of_files) ⇒ Object



765
766
767
768
769
# File 'lib/saikuro.rb', line 765

def start_count(number_of_files)
  @out.puts "<div class=\"start_token_count\">"
  @out.puts "Number of files: #{number_of_files}"
  @out.puts "</div>"
end

#start_file(file_name) ⇒ Object



771
772
773
774
775
776
777
778
779
# File 'lib/saikuro.rb', line 771

def start_file(file_name)
  @current = file_name
  @out.puts "<div class=\"file_count\">"
  @out.puts "<p class=\"file_name\">"
  @out.puts "File: #{file_name}"
  @out.puts "</p>"
  @out.puts "<table width=\"100%\" border=\"1\">"
  @out.puts "<tr><th>Line</th><th>Tokens</th></tr>"
end