Skip to content

Instantly share code, notes, and snippets.

@rubyworks
Created February 1, 2010 08:52
Show Gist options
  • Save rubyworks/291537 to your computer and use it in GitHub Desktop.
Save rubyworks/291537 to your computer and use it in GitHub Desktop.
Monitor Requires
BEGIN {
module Kernel
h = Hash.new
define_method(:requiree) do
h
end
r = method :require
define_method(:require) do |a|
r.call(a)
h[a] = caller
end
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment