Sha256: 8221b53210fe100b33b262edda6bd3c165c9cd3047534a62ce206b2805b8e9d0

Contents?: true

Size: 449 Bytes

Versions: 320

Compression:

Stored size: 449 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,
  ]

  def path
    @path ||= begin
      REGEXPS.find do |regex|
        message =~ regex
      end
      $1
    end
  end

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

MissingSourceFile = LoadError

Version data entries

320 entries across 276 versions & 28 rubygems

Version Path
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/load_error.rb
activesupport-3.2.22.5 lib/active_support/core_ext/load_error.rb
activesupport-3.2.22.4 lib/active_support/core_ext/load_error.rb
activesupport-3.2.22.3 lib/active_support/core_ext/load_error.rb
activesupport-3.2.22.2 lib/active_support/core_ext/load_error.rb
activesupport-3.2.22.1 lib/active_support/core_ext/load_error.rb
classiccms-0.7.5 vendor/bundle/gems/activesupport-3.2.3/lib/active_support/core_ext/load_error.rb
classiccms-0.7.4 vendor/bundle/gems/activesupport-3.2.3/lib/active_support/core_ext/load_error.rb
classiccms-0.7.3 vendor/bundle/gems/activesupport-3.2.3/lib/active_support/core_ext/load_error.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/core_ext/load_error.rb
activesupport-3.2.22 lib/active_support/core_ext/load_error.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/activesupport-3.2.12/lib/active_support/core_ext/load_error.rb
activesupport-3.2.21 lib/active_support/core_ext/load_error.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/activesupport-3.2.18/lib/active_support/core_ext/load_error.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.18/lib/active_support/core_ext/load_error.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/activesupport-3.2.18/lib/active_support/core_ext/load_error.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/activesupport-3.2.18/lib/active_support/core_ext/load_error.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/activesupport-3.2.18/lib/active_support/core_ext/load_error.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.18/lib/active_support/core_ext/load_error.rb
activesupport-3.2.20 lib/active_support/core_ext/load_error.rb