Skip to content

Commit 721d8cb

Browse files
committed
Incorporate 2.6 versions of 2.7 methods needed
* UnboundMethod#bind_call * ruby2_keywords gem for testing
1 parent 2061f99 commit 721d8cb

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ source "https://rubygems.org"
22

33
gem "rake"
44
gem "test-unit"
5+
gem "ruby2_keywords", group: :test

test/test_pp.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
require 'pp'
44
require 'delegate'
55
require 'test/unit'
6+
require 'ruby2_keywords'
7+
8+
# Define bind_call for Ruby 2.6 and earlier
9+
class UnboundMethod
10+
unless public_method_defined?(:bind_call)
11+
def bind_call(obj, *args, &block)
12+
bind(obj).call(*args, &block)
13+
end
14+
end
15+
end
616

717
module PPTestModule
818

0 commit comments

Comments
 (0)