diff options
author | Xavier Noria <fxn@hashref.com> | 2016-07-22 23:13:42 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-07-22 23:13:49 +0200 |
commit | cfc91c31aa989826e992be29b6d5b181f654f853 (patch) | |
tree | b5ec5569b22f8c796de89335c5ecc7de047130bc /activesupport/lib/active_support/deprecation | |
parent | aea0e5cd709e0fc53e1ba4e87235b8ee3f4bc155 (diff) | |
download | rails-cfc91c31aa989826e992be29b6d5b181f654f853.tar.gz rails-cfc91c31aa989826e992be29b6d5b181f654f853.tar.bz2 rails-cfc91c31aa989826e992be29b6d5b181f654f853.zip |
systematic revision of =~ usage in AS
Where appropriate prefer the more concise Regexp#match?, String#include?,
String#start_with?, and String#end_with?
Diffstat (limited to 'activesupport/lib/active_support/deprecation')
-rw-r--r-- | activesupport/lib/active_support/deprecation/proxy_wrappers.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/deprecation/proxy_wrappers.rb b/activesupport/lib/active_support/deprecation/proxy_wrappers.rb index 0cb2d4d22e..a83c8054ec 100644 --- a/activesupport/lib/active_support/deprecation/proxy_wrappers.rb +++ b/activesupport/lib/active_support/deprecation/proxy_wrappers.rb @@ -1,4 +1,5 @@ require 'active_support/inflector/methods' +require 'active_support/core_ext/regexp' module ActiveSupport class Deprecation @@ -10,7 +11,7 @@ module ActiveSupport super end - instance_methods.each { |m| undef_method m unless m =~ /^__|^object_id$/ } + instance_methods.each { |m| undef_method m unless /^__|^object_id$/.match?(m) } # Don't give a deprecation warning on inspect since test/unit and error # logs rely on it for diagnostics. |