Sha256: f03581a63942d305e82bd335f9c00c07d1c12f6045a884ff1501c6e1a09191c7

Contents?: true

Size: 478 Bytes

Versions: 1

Compression:

Stored size: 478 Bytes

Contents

require "is_dead/version"

module IsDead
  class Error < StandardError; end

  module KernelPatch
    def require(feature)
      super
    end
  end
end

singleton_class.prepend(IsDead::KernelPatch)

require_tp = TracePoint.new(:call) do |tp|
  next unless tp.method_id == :require

  feature = tp.binding.local_variable_get(:feature)
  _ext, feature_path = RubyVM.resolve_feature_path(feature)
  $LOADED_FEATURES << feature_path
end
require_tp.enable(target: method(:require))

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
is_dead-0.1.2 lib/is_dead.rb