Sha256: c545990132613cc4bad42396040a3ffb4a18b608e28b105227b2f077d18ff3f6

Contents?: true

Size: 724 Bytes

Versions: 9

Compression:

Stored size: 724 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.

class << Kernel
  alias_method :load_without_coverage, :load
  def load(path, wrap = false)
    return load_without_coverage(path, wrap) if wrap

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

module Kernel
  def load(path, wrap = false)
    Kernel.require(path, wrap)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
deep-cover-0.1.9 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.1.8 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.1.7 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.1.6 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.1.5 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.1.4 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.1.3 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.1.2 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.1.1 lib/deep_cover/core_ext/load_overrides.rb