BT

Become a Rails Ninja with IRB Hacks

by James Cox on Mar 08, 2007 |

For all you Rails developers tapping your fingers waiting for your pages to load so that your model changes appear - help is at hand in the form of the irb (interactive ruby) console - where you can interact with your rails app from a prompt.

Getting started with the Rails console is really easy and Amy Hoy, frequent author of getting-started guides wrote about her experiences starting up with irb. Want to start on the long road to ninja excellence? Have a good rummage through her excellent tips.

You already know all that stuff - no worries - because the good stuff is just starting. A number of developers have been crafting their own environments, building out a mixture of scripts and gems to create their ultimate environments. We've chosen some of the best to share with you - pick what you like and craft your own.

First we'll start with wirble. Wirble makes your irb colorful - enabling you to quickly see the output from your code. Enabling it is a simple 4 line hack - with the benefits starting right away.

Next are tips from Dr Nic. The good doctor has created a gem - what_methods - which enables you to run .what? on an object to find out more information about an item.

Finally is the ultimate shuriken. To truly be a ninja you should be familiar with these techniques - mapping your app, popping into vim (textmate examples exist elsewhere) and popping into the shell to run svn and shell commands - the shuriken is a fantastic tool for interacting with rails and ruby - and will turn you from a knight into a true ruby ninja.

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

great round-up by Andrew Kuklewicz

I had seen (and enjoyed) Amy Hoy's post before, but the others were new to me and equally as good.

Another cool irb trick I've seen (but never used) is using a Capistrano task to connect remotely and run an irb session. It's from 'err the blog', at the tail of this post: errtheblog.com/post/21

Cheers,
Andrew Kuklewicz

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT