aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/module/delegation.rb
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2016-06-10 11:34:18 -0400
committerJean Boussier <jean.boussier@gmail.com>2016-06-10 11:34:18 -0400
commite8148a5cf401b677227397680c3d8a99ef747770 (patch)
treeb7e970a2c4311798a1953c67c9e5fa7110934252 /activesupport/lib/active_support/core_ext/module/delegation.rb
parent527200a456f50428984671f6ca41cb9e82077cb7 (diff)
downloadrails-e8148a5cf401b677227397680c3d8a99ef747770.tar.gz
rails-e8148a5cf401b677227397680c3d8a99ef747770.tar.bz2
rails-e8148a5cf401b677227397680c3d8a99ef747770.zip
Replace Kernel#caller by the faster Kernel#caller_locations
Diffstat (limited to 'activesupport/lib/active_support/core_ext/module/delegation.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/module/delegation.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb
index 7f968d10b5..3f6e8bd26c 100644
--- a/activesupport/lib/active_support/core_ext/module/delegation.rb
+++ b/activesupport/lib/active_support/core_ext/module/delegation.rb
@@ -164,8 +164,8 @@ class Module
''
end
- file, line = caller(1, 1).first.split(':'.freeze, 2)
- line = line.to_i
+ location = caller_locations(1, 1).first
+ file, line = location.path, location.lineno
to = to.to_s
to = "self.#{to}" if DELEGATION_RESERVED_METHOD_NAMES.include?(to)