Class: Polint::Checker

Inherits:
Object
  • Object
show all
Defined in:
lib/polint.rb

Constant Summary collapse

AttributeRe =
/
  %\{ [^\}]+ \}  |     # Ruby Gettext
  %\( [^\)]+ \)[sd] |  # Javascript sprintf
  \{\{ [^\}] \}\}      # Liquid
/x
TA =
Term::ANSIColor

Instance Method Summary collapse

Constructor Details

#initialize(pofile) ⇒ Checker

Returns a new instance of Checker.



25
26
27
# File 'lib/polint.rb', line 25

def initialize(pofile)
  @pofile = pofile
end

Instance Method Details

#runObject



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/polint.rb', line 29

def run
  @verbose = !!ENV["VERBOSE"]
  @errors  = 0
  @fuzzies = 0

  lint_po
  parse_data annotate_and_load_po

  total_errors = @errors + @fuzzies
  $stderr.puts "#{@errors} warnings, #{@fuzzies} fuzzies." if total_errors > 0
  return total_errors
end