def require(path) # &fallback_block
      raise 'Should receive the fallback_block' unless block_given?
      path = path.to_s

      found_path = resolve_path(path)

      if found_path
        return false if @loaded_features.include?(found_path)
        return false if @paths_being_required.include?(found_path)
      end

      DeepCover.autoload_tracker.wrap_require(path, found_path) do
        begin
          # Either a problem with resolve_path, or a gem that will be added to the load_path by RubyGems
          return yield(:not_found) unless found_path

          @paths_being_required.add(found_path)
          return yield(:not_in_covered_paths) unless DeepCover.tracked_file_path?(found_path)
          return yield(:not_supported) if REQUIRABLE_EXTENSIONS[File.extname(found_path)] == :native_extension
          return yield(:skipped) if filter && filter.call(found_path)

          cover_and_execute(found_path) { |reason| return yield(reason) }

          @loaded_features << found_path
        ensure
          @paths_being_required.delete(found_path)
          add_last_loaded_feature_to_set
        end
      end
      true
    end
def require(path) # &fallback_block
      raise 'Should receive the fallback_block' unless block_given?
      path = path.to_s

      found_path = resolve_path(path)

      if found_path
        return false if @loaded_features.include?(found_path)
        return false if @paths_being_required.include?(found_path)
      end

      DeepCover.autoload_tracker.wrap_require(path, found_path) do
        begin
          # Either a problem with resolve_path, or a gem that will be added to the load_path by RubyGems
          return yield(:not_found) unless found_path

          @paths_being_required.add(found_path)
          return yield(:not_in_covered_paths) unless DeepCover.tracked_file_path?(found_path)
          return yield(:not_supported) if REQUIRABLE_EXTENSIONS[File.extname(found_path)] == :native_extension
          return yield(:skipped) if filter && filter.call(found_path)

          cover_and_execute(found_path) { |reason| return yield(reason) }

          @loaded_features << found_path
        ensure
          @paths_being_required.delete(found_path)
          add_last_loaded_feature_to_set
        end
      end
      true
    end
Homemade #require to be able to instrument the code before it gets executed.
 Returns true when everything went right. (Same as regular ruby)
 Returns false when the found file was already required. (Same as regular ruby)
 Calls &fallback_block with the reason as parameter if the work couldn't be done.
 The possible reasons are:
  - :not_found if the file couldn't be found.
  - :not_in_covered_paths if the file is not in the paths to cover
  - :cover_failed if DeepCover couldn't apply instrumentation the file found.
  - :not_supported for files that are not supported (such as .so files)
  - :skipped if the filter block returned `true`
 Exceptions raised by the required code bubble up as normal, except for
 SyntaxError, which is turned into a :cover_failed which calls the fallback_block.