Navigation Menu

Skip to content

Commit

Permalink
Merge pull request rails#6711 from takkanm/fix-warning-LoadError-path…
Browse files Browse the repository at this point in the history
…-method

fix method redefined warning in Ruby2.0
  • Loading branch information
José Valim committed Jun 12, 2012
2 parents 5ea2b11 + a599c03 commit 122f6de
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 122f6de

Please sign in to comment.