lib/contrast/agent/assess/policy/policy_scanner.rb in contrast-agent-4.13.1 vs lib/contrast/agent/assess/policy/policy_scanner.rb in contrast-agent-4.14.0
- old
+ new
@@ -30,11 +30,16 @@
return if trace_point.path.start_with?(Gem.dir)
mod = trace_point.self
return if mod.cs__frozen? || mod.singleton_class?
+ different_ruby_version trace_point, provider_values, mod
+ end
+
+ def different_ruby_version trace_point, provider_values, mod
# TODO: RUBY-1014 - remove non-AST approach
if RUBY_VERSION >= '2.6.0'
+ # TODO: RUBY-714 EOL 2.5. That check will be removed and the code will be brought back in here.
ast = RubyVM::AbstractSyntaxTree.parse_file(trace_point.path)
provider_values.each do |provider|
provider.parse(trace_point, ast)
end
else