Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix method redefined warning in Ruby2.0

Ruby2.0 already has LoadError#path.
  • Loading branch information...
commit a599c034fd525d9adccc93b009a958e04d1dc333 1 parent e6ea3fe
@takkanm takkanm authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.