From e69ace89a357b0d3d67d48bb239a06962347b6f2 Mon Sep 17 00:00:00 2001 From: Justin Collins Date: Fri, 24 Feb 2012 09:55:38 -0800 Subject: [PATCH] Add Util.node_type? --- lib/brakeman/util.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/brakeman/util.rb b/lib/brakeman/util.rb index dea07ebb..87f4d351 100644 --- a/lib/brakeman/util.rb +++ b/lib/brakeman/util.rb @@ -192,6 +192,11 @@ module Brakeman::Util exp.is_a? Sexp end + #Check if _exp_ is a Sexp and the node type matches one of the given types. + def node_type? exp, *types + exp.is_a? Sexp and types.include? exp.node_type + end + #Return file name related to given warning. Uses +warning.file+ if it exists def file_for warning, tracker = nil if tracker.nil? -- GitLab