aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-09-07 12:41:16 -0700
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-11-30 15:53:42 +0900
commit9fa0166a580e72adf02562b7d60672c6c362d4b7 (patch)
treed4a5658bd122a3c48633f2dad7f4f11241b5a828 /lib
parentaf4b3f16ceed36f8b18856120940c9de6e6a0eee (diff)
downloadruby-9fa0166a580e72adf02562b7d60672c6c362d4b7.tar.gz
[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')
-rw-r--r--lib/forwardable.rb5
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