diff options
author | Steven Harman <steven@harmanly.com> | 2014-04-11 16:04:53 -0400 |
---|---|---|
committer | Steven Harman <steven@harmanly.com> | 2014-04-11 16:04:53 -0400 |
commit | d870cfd981d017fb39ae805832cbef773e7abc02 (patch) | |
tree | 4460f90c79c8d99bf82f9d0432695cf409277074 /activesupport | |
parent | 9efab213d29adcc708cc08e8f45933223900fc70 (diff) | |
download | rails-d870cfd981d017fb39ae805832cbef773e7abc02.tar.gz rails-d870cfd981d017fb39ae805832cbef773e7abc02.tar.bz2 rails-d870cfd981d017fb39ae805832cbef773e7abc02.zip |
Document LoadError core extensions
[ci skip]
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/load_error.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/load_error.rb b/activesupport/lib/active_support/core_ext/load_error.rb index fe24f3716d..81eaee8ca3 100644 --- a/activesupport/lib/active_support/core_ext/load_error.rb +++ b/activesupport/lib/active_support/core_ext/load_error.rb @@ -7,6 +7,7 @@ class LoadError ] unless method_defined?(:path) + # Returns the path which was unable to be loaded. def path @path ||= begin REGEXPS.find do |regex| @@ -17,9 +18,11 @@ class LoadError end end + # Returns <tt>true</tt> 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
\ No newline at end of file +MissingSourceFile = LoadError |