diff options
author | Jeremy Evans <[email protected]> | 2019-09-07 12:41:16 -0700 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2019-11-30 15:53:42 +0900 |
commit | 9fa0166a580e72adf02562b7d60672c6c362d4b7 (patch) | |
tree | d4a5658bd122a3c48633f2dad7f4f11241b5a828 /lib/forwardable.rb | |
parent | af4b3f16ceed36f8b18856120940c9de6e6a0eee (diff) |
[ruby/forwardable] Fix keyword argument separation warnings on Ruby 2.7+
Do so in a way that is also compatible with previous versions.
https://github.com/ruby/forwardable/commit/b2dd340988
Diffstat (limited to 'lib/forwardable.rb')
-rw-r--r-- | lib/forwardable.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/forwardable.rb b/lib/forwardable.rb index 924c605c6e..e8333a359e 100644 --- a/lib/forwardable.rb +++ b/lib/forwardable.rb @@ -183,7 +183,9 @@ module Forwardable gen = Forwardable._delegator_method(self, accessor, method, ali) # If it's not a class or module, it's an instance - (Module === self ? self : singleton_class).module_eval(&gen) + mod = Module === self ? self : singleton_class + mod.module_eval(&gen) + mod.send(:ruby2_keywords, ali) if RUBY_VERSION >= '2.7' end alias delegate instance_delegate @@ -301,6 +303,7 @@ module SingleForwardable gen = Forwardable._delegator_method(self, accessor, method, ali) instance_eval(&gen) + singleton_class.send(:ruby2_keywords, ali) if RUBY_VERSION >= '2.7' end alias delegate single_delegate |