The goal is to have a small and cleaned up version of IRB. Trimmed down to only do the stuff I, and most people I know, actually use.
Trimming down the core code is done mainly by using Ripper, which comes with Ruby 1.9, instead of shipping it's own parser etc.
There's still lots to be done, but the ‘basic functionality’ as is now, should not grow too much more. For now my things to-do are .irbrc support, completion, and investigate what else people really really need. After that it's time to polish.
cypher: irb_rocket, utility_belt, hirb, and awesome_print. I also occasionally use sketches, but I wouldn't really miss it if I didn't have it.
iain_nl: Wirble, AwesomePrint, Hirb. My irbrc: gist.github.com/368237
svoop: Looksee, Wirble, Hirb and copy&paste support.
irbaddict: is use Ben Bleything's irb history hack see lighting talks rubyconf 2006
logankoester: You can find my irbrc over at github if you want to take a look. (github.com/logankoester/irbrc) I've modified my IRB quite extensively: map_by_method what_methods prettyprint (pp) awesome_print net-http-spy the usual simple prompt, tab completion, auto indent wirble “clear” method to clear the screen fast load/reload shortcuts sketches
trans: Wirble and of course irb/completion and history. I try not to get too crazy about it b/c the more extensions you have the less you have a true Ruby slate to work with. Hmm.. which makes me think a command-line option to turn off most of it would be cool. Perhaps even two or three levels.
This IRB version specifically targets MacRuby, for now, and allows Cocoa development to be done from the command-line. Dietrb will automatically override the normal runloop to be ran in a thread and start a NSRunLoop on the main thread.
Dietrb will try to warn about syntax errors as soon as a line is entered and only reset the buffer to the previous line. This means that you don't need to loose any previous work:
irb(main):001:0> class A irb(main):002:1> def foo irb(main):003:2> } p :ok irb(main):004:1> end SyntaxError: compile error (irb):3: syntax error, unexpected '}' } p :ok ^ (irb):4: syntax error, unexpected $end, expecting kEND from (irb):4 from :0 irb(main):005:0> A.new.foo NameError: uninitialized constant A from (irb):5 from :0
irb(main):001:0> class A irb(main):002:1> def foo irb(main):003:2> } p :ok SyntaxError: compile error (irb):3: syntax error, unexpected '}' irb(main):004:2> p :ok irb(main):005:2> end irb(main):006:1> end => nil irb(main):007:0> A.new.foo :ok => :ok
irb(main):001:0> class A irb(main):002:1> def foo irb(main):003:2> :ok irb(main):004:2> end irb(main):005:1> end => nil irb(main):006:0> irb A.new irb(#<#<Class:…>::A:…>):001:0> foo => :ok irb(#<#<Class:…>::A:…>):002:0> quit => nil irb(main):007:0> quit
Or on MacRuby, try:
irb(main):001:0> win = NSWindow.alloc.initWithContentRect([200, 300, 250, 100], irb(main):002:0> styleMask: NSTitledWindowMask|NSResizableWindowMask, irb(main):003:0> backing: NSBackingStoreBuffered, irb(main):004:0> defer: false) => #<NSWindow:0x20023eb00> irb(main):005:0> win.orderFrontRegardless => #<NSWindow:0x20023eb00> irb(main):006:0> win.title = 'Hello World' => "Hello World" irb(main):007:0> bye = NSButton.alloc.initWithFrame([10, 10, 80, 80]) => #<NSButton:0x20027f820> irb(main):008:0> win.contentView.addSubview(bye) => #<NSView:0x200210320> irb(main):009:0> bye.bezelStyle = NSThickerSquareBezelStyle => 4 irb(main):010:0> bye.title = 'Goodbye!' => "Goodbye!" irb(main):011:0> bye.target = NSApp => #<NSApplication:0x200257fe0> irb(main):012:0> bye.action = 'terminate:' => "terminate:" irb(main):013:0> bye.sound = NSSound.soundNamed('Basso') => #<NSSound:0x200248b20>