Sha256: aeab3539da64e7f2ef2b83510868da77cd336c6ca80d0d67bfa820f9b82a4beb

Contents?: true

Size: 613 Bytes

Versions: 11

Compression:

Stored size: 613 Bytes

Contents

module Roodi
  module Core
    class CheckingVisitor
      def initialize(*checks)
        @checks ||= {}
        checks.first.each do |check|
          nodes = check.interesting_nodes
          nodes.each do |node|
            @checks[node] ||= []
            @checks[node] << check
            @checks[node].uniq!
          end
        end
      end

      def visit(node)
        @last_newline = node if node.node_type == :newline
        checks = @checks[node.node_type]
        checks.each {|check| check.evaluate_node_at_line(node, @last_newline)} unless checks.nil?
        nil
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
roodi-0.5 lib/roodi/core/checking_visitor.rb
roodi-1.1.0 lib/roodi/core/checking_visitor.rb
roodi-1.3.2 lib/roodi/core/checking_visitor.rb
roodi-1.1.1 lib/roodi/core/checking_visitor.rb
roodi-1.2.0 lib/roodi/core/checking_visitor.rb
roodi-1.3.4 lib/roodi/core/checking_visitor.rb
roodi-1.3.0 lib/roodi/core/checking_visitor.rb
roodi-1.3.6 lib/roodi/core/checking_visitor.rb
roodi-1.3.3 lib/roodi/core/checking_visitor.rb
roodi-1.3.7 lib/roodi/core/checking_visitor.rb
roodi-1.3.5 lib/roodi/core/checking_visitor.rb