Class: IrbCallbacks

Inherits:
Object
  • Object
show all
Defined in:
lib/irb_callbacks.rb

Overview

irb’s control flow looks like this:

loop:

* prompt
* eval
* output

This gem adds three callbacks to each phase, so you can override and provide your own functionality.

module IRB:

* self.before_prompt
* self.around_prompt (call yield)
* self.after_prompt

* self.before_eval
* self.around_eval (call yield)
* self.after_eval

* self.before_output
* self.around_output (call yield)
* self.after_output

Some ideas to get you started:

* automatic benchmarking

  (see the readme)

* examine objectspace for leaks

* tail the rails logs from irb

You can automate irb to load up your changes each time you fire it up by adding the following to .irbrc in your home directory:

require 'rubygems'
require 'irb_callbacks'

... your code ...

If you’ve got any requests or complaints, please e-mail [email protected].

Constant Summary collapse

VERSION =
'0.1.0'