Class: TokenCounterFormater

Inherits:
BaseFormater show all
Defined in:
lib/saikuro.rb

Direct Known Subclasses

HTMLTokenCounterFormater

Instance Attribute Summary

Attributes inherited from BaseFormater

#current, #errors, #warnings

Instance Method Summary collapse

Methods inherited from BaseFormater

#initialize, #reset_data, #warn_error?

Constructor Details

This class inherits a constructor from BaseFormater

Instance Method Details

#endObject



681
682
# File 'lib/saikuro.rb', line 681

def end
end

#end_countObject



678
679
# File 'lib/saikuro.rb', line 678

def end_count
end

#end_fileObject



674
675
676
# File 'lib/saikuro.rb', line 674

def end_file
  @out.puts ""
end

#line_token_count(line_number, number_of_tokens) ⇒ Object



668
669
670
671
672
# File 'lib/saikuro.rb', line 668

def line_token_count(line_number,number_of_tokens)
  return if @filter.ignore?(number_of_tokens)
  warn_error?(number_of_tokens, line_number)
  @out.puts "Line:#{line_number} ; Tokens : #{number_of_tokens}"
end

#start(new_out = nil) ⇒ Object



653
654
655
656
657
# File 'lib/saikuro.rb', line 653

def start(new_out=nil)
  reset_data
  @out = new_out if new_out
  @out.puts "Token Count"
end

#start_count(number_of_files) ⇒ Object



659
660
661
# File 'lib/saikuro.rb', line 659

def start_count(number_of_files)
  @out.puts "Counting tokens for #{number_of_files} files."
end

#start_file(file_name) ⇒ Object



663
664
665
666
# File 'lib/saikuro.rb', line 663

def start_file(file_name)
  @current = file_name
  @out.puts "File:#{file_name}"
end