1 class MissingSourceFile
< LoadError
#:nodoc:
3 def initialize(message
, path
)
9 path
.gsub(/\.rb$/, '') == self.path
.gsub(/\.rb$/, '')
12 def self.from_message(message
)
13 REGEXPS
.each
do |regexp
, capture
|
14 match
= regexp
.match(message
)
15 return MissingSourceFile
.new(message
, match
[capture
]) unless match
.nil?
21 [/^no such file to load -- (.+)$/i
, 1],
22 [/^Missing \w+ (file\s*)?([^\s]+.rb)$/i
, 2],
23 [/^Missing API definition file in (.+)$/i
, 1]
24 ] unless defined?(REGEXPS
)
27 module ActiveSupport
#:nodoc:
28 module CoreExtensions
#:nodoc:
29 module LoadErrorExtensions
#:nodoc:
30 module LoadErrorClassMethods
#:nodoc:
32 (self == LoadError
&& MissingSourceFile
.from_message(args
.first
)) || super
35 ::LoadError.extend(LoadErrorClassMethods
)