Module: DeepCover::RequireOverride

Extended by:
ModuleOverride
Defined in:
lib/deep_cover/core_ext/require_overrides.rb

Instance Attribute Summary

Attributes included from ModuleOverride

#overriden_modules

Instance Method Summary collapse

Methods included from ModuleOverride

active=, each, override

Instance Method Details

#require(path) ⇒ Object



13
14
15
# File 'lib/deep_cover/core_ext/require_overrides.rb', line 13

def require(path)
  DeepCover.custom_requirer.require(path) { require_without_deep_cover(path) }
end

#require_relative(path) ⇒ Object

Raises:

  • (LoadError)


17
18
19
20
21
22
23
# File 'lib/deep_cover/core_ext/require_overrides.rb', line 17

def require_relative(path)
  base = caller(1..1).first[/[^:]+/]
  raise LoadError, 'cannot infer basepath' unless base
  base = File.dirname(base)

  require(File.absolute_path(path, base))
end