lib/pelusa/lint/eval_usage.rb in pelusa-0.2.2 vs lib/pelusa/lint/eval_usage.rb in pelusa-0.2.3

- old
+ new

@@ -1,11 +1,10 @@ # encoding: utf-8 module Pelusa module Lint class EvalUsage - def initialize @violations = Set.new end def check(klass) @@ -25,13 +24,12 @@ def name "Doesn't use eval statement" end def iterate_lines!(klass) - iterator = Iterator.new do |node| + ClassAnalyzer.walk(klass) do |node| @violations << node.line if eval_violation?(node) end - Array(klass).each(&iterator) end def eval_violation?(node) node.is_a?(Rubinius::AST::SendWithArguments) && node.name == :eval && node.receiver.is_a?(Rubinius::AST::Self) end \ No newline at end of file