lib/yard/verifier.rb in yard-0.9.5 vs lib/yard/verifier.rb in yard-0.9.6
- old
+ new
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
module YARD
# Similar to a Proc, but runs a set of Ruby expressions using a small
# DSL to make tag lookups easier.
#
# The syntax is as follows:
@@ -128,9 +129,10 @@
# @return [void]
def create_method_from_expressions
expr = expressions.map {|e| "(#{parse_expression(e)})" }.join(" && ")
instance_eval(<<-eof, __FILE__, __LINE__ + 1)
+ begin; undef __execute; rescue NameError; end
def __execute; #{expr}; end
eof
end
# Parses a single expression, handling some of the DSL syntax.