Skip to content

Commit a599c03

Browse files
committed
fix method redefined warning in Ruby2.0
Ruby2.0 already has LoadError#path.
1 parent e6ea3fe commit a599c03

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

activesupport/lib/active_support/core_ext/load_error.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ class LoadError
66
/^cannot load such file -- (.+)$/i,
77
]
88

9-
def path
10-
@path ||= begin
11-
REGEXPS.find do |regex|
12-
message =~ regex
9+
unless method_defined?(:path)
10+
def path
11+
@path ||= begin
12+
REGEXPS.find do |regex|
13+
message =~ regex
14+
end
15+
$1
1316
end
14-
$1
1517
end
1618
end
1719

0 commit comments

Comments
 (0)