1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

fix method redefined warning in Ruby2.0
This commit is contained in:
José Valim 2012-06-12 02:34:07 -07:00
commit 122f6de2e0

View file

@ -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