Sha256: c893d1faf19bc19f28c042a0b4420aa3257bb762c647e914629699e6ebe63eca

Contents?: true

Size: 714 Bytes

Versions: 5

Compression:

Stored size: 714 Bytes

Contents

# These are the monkeypatches to replace the default #load in order
# to instrument the code before it gets run.
# For now, this is not used, and may never be. The tracking and reporting for things can might be
# loaded multiple times can be complex and is beyond the current scope of the project.

module DeepCover
  module LoadOverride
    def load(path, wrap = false)
      return load_without_deep_cover(path, wrap) if wrap

      result = DeepCover.custom_requirer.load(path)
      if [:not_found, :cover_failed, :not_supported].include?(result)
        load_without_deep_cover(path)
      else
        result
      end
    end
  end

  extend ModuleOverride
  override ::Kernel, ::Kernel.singleton_class
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
deep-cover-0.1.14 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.1.13 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.1.12 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.1.11 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.1.10 lib/deep_cover/core_ext/load_overrides.rb