Sha256: abe147513e4b5015cdcd7510b7aec5fec45e7b6278c295927a14487ac61facc3

Contents?: true

Size: 707 Bytes

Versions: 8

Compression:

Stored size: 707 Bytes

Contents

# frozen_string_literal: true

# 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 = catch(:use_fallback) { DeepCover.custom_requirer.load(path) }
      result = load_without_deep_cover(path) if result.is_a? Symbol
      result
    end
  end

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
deep-cover-0.5.2 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.5.1 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.5.0 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.4.0 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.3.0 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.2.0 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.1.16 lib/deep_cover/core_ext/load_overrides.rb
deep-cover-0.1.15 lib/deep_cover/core_ext/load_overrides.rb