Skip to content

Instantly share code, notes, and snippets.

@clausd
Created April 25, 2016 15:36
Show Gist options
  • Save clausd/f30d6cfe7f9044d755dfe3310ff4fb61 to your computer and use it in GitHub Desktop.
Save clausd/f30d6cfe7f9044d755dfe3310ff4fb61 to your computer and use it in GitHub Desktop.
class IntrospectBinding
attr_accessor :binding, :evals
def initialize(binding)
@binding = binding
@evals = []
end
def eval(string, filename = '', lineno = 0)
@evals.push([string, filename, lineno])
binding.eval(string, filename, lineno)
end
def method_missing(method_sym, *arguments, &block)
binding.send(method_sym, *arguments, &block)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment