From 3161fd437210588ef7ce41d614ab317de11d2ec1 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Wed, 11 Jan 2023 11:00:58 +0100 Subject: [ruby/psych] Get rid of anonymous eval calls Things declared in anonymous eval are always annoying to locate. https://github.com/ruby/psych/commit/38871ad4e5 --- test/psych/test_encoding.rb | 4 ++-- test/psych/test_parser.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'test/psych') diff --git a/test/psych/test_encoding.rb b/test/psych/test_encoding.rb index 7d33814805..1867d59ea6 100644 --- a/test/psych/test_encoding.rb +++ b/test/psych/test_encoding.rb @@ -13,13 +13,13 @@ module Psych (Handler.instance_methods(true) - Object.instance_methods).each do |m| - class_eval %{ + class_eval <<~RUBY, __FILE__, __LINE__ + 1 def #{m} *args @strings += args.flatten.find_all { |a| String === a } end - } + RUBY end end diff --git a/test/psych/test_parser.rb b/test/psych/test_parser.rb index e087e319a5..3b67a8eab1 100644 --- a/test/psych/test_parser.rb +++ b/test/psych/test_parser.rb @@ -16,13 +16,13 @@ module Psych (Handler.instance_methods(true) - Object.instance_methods).each do |m| - class_eval %{ + class_eval <<~RUBY, __FILE__, __LINE__ + 1 def #{m} *args super @marks << @parser.mark if @parser @calls << [:#{m}, args] end - } + RUBY end end -- cgit v1.2.3