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:
commit
122f6de2e0
1 changed files with 7 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue