fix method redefined warning in Ruby2.0

Ruby2.0 already has LoadError#path.
This commit is contained in:
Mitsutaka Mimura 2012-06-12 17:37:56 +09:00
parent e6ea3fec30
commit a599c034fd

@ -6,6 +6,7 @@ class LoadError
/^cannot load such file -- (.+)$/i,
]
unless method_defined?(:path)
def path
@path ||= begin
REGEXPS.find do |regex|
@ -14,6 +15,7 @@ def path
$1
end
end
end
def is_missing?(location)
location.sub(/\.rb$/, '') == path.sub(/\.rb$/, '')