Skip to content

Commit

Permalink
fix method redefined warning in Ruby2.0
Browse files Browse the repository at this point in the history
Ruby2.0 already has LoadError#path.
  • Loading branch information
takkanm committed Jun 12, 2012
1 parent e6ea3fe commit a599c03
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions activesupport/lib/active_support/core_ext/load_error.rb
Expand Up @@ -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

Expand Down

0 comments on commit a599c03

Please sign in to comment.