Sha256: b11af8bc3fb4a889ccf4bf066ea645dbf0011519dc916950c7abe919ecf3966c

Contents?: true

Size: 503 Bytes

Versions: 76

Compression:

Stored size: 503 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)
    def path
      @path ||= begin
        REGEXPS.find do |regex|
          message =~ regex
        end
        $1
      end
    end
  end

  def is_missing?(location)
    location.sub(/\.rb$/, '') == path.sub(/\.rb$/, '')
  end
end

MissingSourceFile = LoadError

Version data entries

76 entries across 76 versions & 5 rubygems

Version Path
activesupport-4.1.16 lib/active_support/core_ext/load_error.rb
activesupport-4.1.16.rc1 lib/active_support/core_ext/load_error.rb
activesupport-4.1.15 lib/active_support/core_ext/load_error.rb
activesupport-4.1.15.rc1 lib/active_support/core_ext/load_error.rb
activesupport-4.1.14.2 lib/active_support/core_ext/load_error.rb
activesupport-4.1.14.1 lib/active_support/core_ext/load_error.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/activesupport-4.1.13/lib/active_support/core_ext/load_error.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/activesupport-4.1.13/lib/active_support/core_ext/load_error.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/activesupport-4.1.13/lib/active_support/core_ext/load_error.rb
activesupport-4.1.14 lib/active_support/core_ext/load_error.rb
activesupport-4.1.14.rc2 lib/active_support/core_ext/load_error.rb
activesupport-4.1.14.rc1 lib/active_support/core_ext/load_error.rb
activesupport-4.1.13 lib/active_support/core_ext/load_error.rb
activesupport-4.1.13.rc1 lib/active_support/core_ext/load_error.rb
activesupport-4.1.12 lib/active_support/core_ext/load_error.rb
activesupport-4.1.12.rc1 lib/active_support/core_ext/load_error.rb
activesupport-4.1.11 lib/active_support/core_ext/load_error.rb
activesupport-4.1.10 lib/active_support/core_ext/load_error.rb
activesupport-4.1.10.rc4 lib/active_support/core_ext/load_error.rb
activesupport-4.1.10.rc3 lib/active_support/core_ext/load_error.rb