class Syntaxer::Checker
Attributes
reader[RW]
syntaxer[RW]
Public Class Methods
new(syntaxer, count)
click to toggle source
# File lib/syntaxer/checker.rb, line 14 def initialize(syntaxer, count) Printer.setup do |p| p.count_of_files = count p.mode = syntaxer.hook ? :hook : :default end add_observer(Printer) @syntaxer = syntaxer @reader = @syntaxer.reader @results = [] end
process(syntaxer)
click to toggle source
Factory for checker
@return [RepoChecker, process]
# File lib/syntaxer/checker.rb, line 30 def self.process(syntaxer) if syntaxer.repository RepoChecker.new(syntaxer).process else PlainChecker.new(syntaxer).process end end
Protected Instance Methods
check(rule, file)
click to toggle source
# File lib/syntaxer/checker.rb, line 40 def check rule, file changed unless rule.exec_existence # notify if not exists notify_observers({:rule => rule}) else if @syntaxer.warnings && rule.name == :ruby rule.exec_rule.exec_rule = rule.exec_rule.exec_rule.gsub(/(-\S+)\s/,'\1w ') end errors = rule.exec_rule.run(file) FileStatus.build(file, errors) notify_observers({:file_status => errors.empty?}) end end