diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-12-21 01:39:18 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-12-21 01:39:18 +0900 |
commit | 8034dde023a64b98c6b3edb80a44e4cc23f8979f (patch) | |
tree | 38ad756d57390a272bceb7068c19ad1e25587689 /activesupport/lib/active_support/deprecation | |
parent | 3da358ea83b86368021d6f289627d0682d24d30b (diff) | |
download | rails-8034dde023a64b98c6b3edb80a44e4cc23f8979f.tar.gz rails-8034dde023a64b98c6b3edb80a44e4cc23f8979f.tar.bz2 rails-8034dde023a64b98c6b3edb80a44e4cc23f8979f.zip |
Module#{define_method,alias_method,undef_method,remove_method} become public since Ruby 2.5
https://bugs.ruby-lang.org/issues/14133
Diffstat (limited to 'activesupport/lib/active_support/deprecation')
-rw-r--r-- | activesupport/lib/active_support/deprecation/method_wrappers.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/deprecation/method_wrappers.rb b/activesupport/lib/active_support/deprecation/method_wrappers.rb index f0c3e37e65..d99571790f 100644 --- a/activesupport/lib/active_support/deprecation/method_wrappers.rb +++ b/activesupport/lib/active_support/deprecation/method_wrappers.rb @@ -60,13 +60,13 @@ module ActiveSupport with_method = "#{aliased_method}_with_deprecation#{punctuation}" without_method = "#{aliased_method}_without_deprecation#{punctuation}" - target_module.send(:define_method, with_method) do |*args, &block| + target_module.define_method(with_method) do |*args, &block| deprecator.deprecation_warning(method_name, options[method_name]) send(without_method, *args, &block) end - target_module.send(:alias_method, without_method, method_name) - target_module.send(:alias_method, method_name, with_method) + target_module.alias_method(without_method, method_name) + target_module.alias_method(method_name, with_method) case when target_module.protected_method_defined?(without_method) @@ -75,7 +75,7 @@ module ActiveSupport target_module.send(:private, method_name) end else - mod.send(:define_method, method_name) do |*args, &block| + mod.define_method(method_name) do |*args, &block| deprecator.deprecation_warning(method_name, options[method_name]) super(*args, &block) end |