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



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

def end
end

#end_countObject



676
677
# File 'lib/saikuro.rb', line 676

def end_count
end

#end_fileObject



672
673
674
# File 'lib/saikuro.rb', line 672

def end_file
  @out.puts ""
end

#line_token_count(line_number, number_of_tokens) ⇒ Object



666
667
668
669
670
# File 'lib/saikuro.rb', line 666

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



651
652
653
654
655
# File 'lib/saikuro.rb', line 651

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

#start_count(number_of_files) ⇒ Object



657
658
659
# File 'lib/saikuro.rb', line 657

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

#start_file(file_name) ⇒ Object



661
662
663
664
# File 'lib/saikuro.rb', line 661

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