Class: Cyclomagic::HTMLTokenCounterFormater
Instance Attribute Summary
Attributes inherited from BaseFormater
#current, #errors, #warnings
Instance Method Summary
collapse
style_sheet, #style_sheet
#initialize, #reset_data, #warn_error?
Instance Method Details
#end ⇒ Object
772
773
774
775
|
# File 'lib/cyclomagic.rb', line 772
def end
@out.puts "</body>"
@out.puts "</html>"
end
|
#end_count ⇒ Object
769
770
|
# File 'lib/cyclomagic.rb', line 769
def end_count
end
|
#end_file ⇒ Object
765
766
767
|
# File 'lib/cyclomagic.rb', line 765
def end_file
@out.puts "</table>"
end
|
#line_token_count(line_number, number_of_tokens) ⇒ Object
759
760
761
762
763
|
# File 'lib/cyclomagic.rb', line 759
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
735
736
737
738
739
740
741
|
# File 'lib/cyclomagic.rb', line 735
def start(new_out=nil)
reset_data
@out = new_out if new_out
@out.puts "<html>"
@out.puts style_sheet
@out.puts "<body>"
end
|
#start_count(number_of_files) ⇒ Object
743
744
745
746
747
|
# File 'lib/cyclomagic.rb', line 743
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
749
750
751
752
753
754
755
756
757
|
# File 'lib/cyclomagic.rb', line 749
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
|