From 721d8cbd103768bf743487bc5bd1c25a31bd2ca7 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Tue, 28 Sep 2021 09:53:03 -0500 Subject: [PATCH] Incorporate 2.6 versions of 2.7 methods needed * UnboundMethod#bind_call * ruby2_keywords gem for testing --- Gemfile | 1 + test/test_pp.rb | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/Gemfile b/Gemfile index eb86192..0ab3dc1 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,4 @@ source "https://rubygems.org" gem "rake" gem "test-unit" +gem "ruby2_keywords", group: :test \ No newline at end of file diff --git a/test/test_pp.rb b/test/test_pp.rb index 4aa3195..ab8f959 100644 --- a/test/test_pp.rb +++ b/test/test_pp.rb @@ -3,6 +3,16 @@ 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