ruby-changes:70295
From: Charles <ko1@a...>
Date: Sat, 18 Dec 2021 09:31:09 +0900 (JST)
Subject: [ruby-changes:70295] cc73dfb92a (master): [ruby/pp] Incorporate 2.6 versions of 2.7 methods needed
https://git.ruby-lang.org/ruby.git/commit/?id=cc73dfb92a From cc73dfb92a4bd15d48217d4697a78a5814213e07 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter <headius@h...> Date: Tue, 28 Sep 2021 09:53:03 -0500 Subject: [ruby/pp] Incorporate 2.6 versions of 2.7 methods needed * UnboundMethod#bind_call * ruby2_keywords gem for testing https://github.com/ruby/pp/commit/721d8cbd10 --- test/test_pp.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/test_pp.rb b/test/test_pp.rb index 4aa31954552..ab8f9595f48 100644 --- a/test/test_pp.rb +++ b/test/test_pp.rb @@ -3,6 +3,16 @@ https://github.com/ruby/ruby/blob/trunk/test/test_pp.rb#L3 require 'pp' require 'delegate' require 'test/unit' +require 'ruby2_keywords' + +# Define bind_call for Ruby 2.6 and earlier +class UnboundMethod + unless public_method_defined?(:bind_call) + def bind_call(obj, *args, &block) + bind(obj).call(*args, &block) + end + end +end module PPTestModule -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/