Shell-style history for irb... now fixed!


#1

Hey all,

Last year during RubyConf, I showed a little hack for adding shell-style
history manipulation to irb. There was a bug in it where history
replays that did assignments were executed in the wrong context, causing
you to not have access to the newly-assigned variable after the replay
was done.

Well, today, I’m happy to announce that this critical bug has been
squashed and I’ve released the 1.0 (for lack of a better version number)
version of the hack. It’s available on my blog, with background info,
here:

http://blog.bleything.net/2007/7/30/announcing-shell-style-history-for-irb-the-fixed-edition

You can take the code linked to from that post and drop it into your
.irbrc and immediately enjoy such tasty methods as h, h!, and hw. I
invite you to experiment!

Back when I first announced this hack, I heard from a couple of people
who were interested in collaborating on a set of IRB hacks. I haven’t
forgotten, I’m just a really terrible correspondent. The upshot for
everyone else is that soon, you may not need to copy and paste the code!
Stay tuned for more info!

Ben