fix method redefined warning in Ruby2.0
Ruby2.0 already has LoadError#path.
This commit is contained in:
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$/, '')
|
||||
|
Loading…
Reference in New Issue
Block a user