Skip to content

Commit

Permalink
Incorporate 2.6 versions of 2.7 methods needed
Browse files Browse the repository at this point in the history
* UnboundMethod#bind_call
* ruby2_keywords gem for testing
  • Loading branch information
headius committed Dec 7, 2021
1 parent 2061f99 commit 721d8cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -2,3 +2,4 @@ source "https://rubygems.org"

gem "rake"
gem "test-unit"
gem "ruby2_keywords", group: :test
10 changes: 10 additions & 0 deletions test/test_pp.rb
Expand Up @@ -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

Expand Down

0 comments on commit 721d8cb

Please sign in to comment.