aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2012-06-12 02:34:07 -0700
committerJosé Valim <jose.valim@plataformatec.com.br>2012-06-12 02:34:07 -0700
commit122f6de2e038dbbece4ee59ddcfcf75ae9c49f63 (patch)
tree5e9c70c8d59f12595816803d1338a36ca99ad92c /activesupport/lib
parent5ea2b11ad7fb1e0e0580edd9d8e0e688cfffa3f2 (diff)
parenta599c034fd525d9adccc93b009a958e04d1dc333 (diff)
downloadrails-122f6de2e038dbbece4ee59ddcfcf75ae9c49f63.tar.gz
rails-122f6de2e038dbbece4ee59ddcfcf75ae9c49f63.tar.bz2
rails-122f6de2e038dbbece4ee59ddcfcf75ae9c49f63.zip
Merge pull request #6711 from takkanm/fix-warning-LoadError-path-method
fix method redefined warning in Ruby2.0
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/load_error.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/core_ext/load_error.rb b/activesupport/lib/active_support/core_ext/load_error.rb
index 8bdfa0c5bc..fe24f3716d 100644
--- a/activesupport/lib/active_support/core_ext/load_error.rb
+++ b/activesupport/lib/active_support/core_ext/load_error.rb
@@ -6,12 +6,14 @@ class LoadError
/^cannot load such file -- (.+)$/i,
]
- def path
- @path ||= begin
- REGEXPS.find do |regex|
- message =~ regex
+ unless method_defined?(:path)
+ def path
+ @path ||= begin
+ REGEXPS.find do |regex|
+ message =~ regex
+ end
+ $1
end
- $1
end
end