Sha256: e18c53616e7b3dc41d4c2aafee87dc642a83be15cc04196cb4aef24b020d6146
Contents?: true
Size: 704 Bytes
Versions: 56
Compression:
Stored size: 704 Bytes
Contents
class LoadError REGEXPS = [ /^no such file to load -- (.+)$/i, /^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i, /^Missing API definition file in (.+)$/i, /^cannot load such file -- (.+)$/i, ] unless method_defined?(:path) # Returns the path which was unable to be loaded. def path @path ||= begin REGEXPS.find do |regex| message =~ regex end $1 end end end # Returns true if the given path name (except perhaps for the ".rb" # extension) is the missing file which caused the exception to be raised. def is_missing?(location) location.sub(/\.rb$/, '') == path.sub(/\.rb$/, '') end end MissingSourceFile = LoadError
Version data entries
56 entries across 54 versions & 10 rubygems