Skip to content
Browse files

Merge pull request #6711 from takkanm/fix-warning-LoadError-path-method

fix method redefined warning in Ruby2.0
  • Loading branch information...
2 parents 5ea2b11 + a599c03 commit 122f6de2e038dbbece4ee59ddcfcf75ae9c49f63 @josevalim josevalim committed
Showing with 7 additions and 5 deletions.
  1. +7 −5 activesupport/lib/active_support/core_ext/load_error.rb
View
12 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

0 comments on commit 122f6de

Please sign in to comment.
Something went wrong with that request. Please try again.