Destroying the Wall between Writing and Executing Code
on March 05, 2007First some notes about IDE’s.
The Knight versus the Ninja
kletch…. kletch…. a loud noise of kletching metal combined with slight floor vibrations left the hall. It was The Knight. His scarred and angry face showed that he was a well experienced warrior, ready for another day of combat for the greater collective cause.
shhh…. shhhh…. what was that? It was probably just the wind. The next day we found the victim dead, with a shuriken-metal-star in his head. The Ninja has made another kill, fighting for the feudal ruler.
If you are the Knight, click here. If you are the agile Ninja, read on.
Using IRB and the Rails Console
A little while ago I read this great article about the Secrets of the Rails Console Ninja’s
My current Rails job in Tokyo required me to use the RadRails IDE on Windows to work on a legacy part the first weeks. The constant switch between script/console, RadRails and my browser inspired me to merge the first two. (Also, sometimes I got rails errors because of :wq symbols in wrong places ;)
I’ve named it Shuriken (the ninja death star) the tool for Rails Console Ninja’s.
You can download it as a .irbrc file which you can just place in your homedir.
Shuriken
Downloading shuriken, place .irbrc in your homedir.
dodo@membrane$ wget http://www.darkwired.org/~dodo/.irbrc
dodo@membrane$ rails webapp > /dev/null; cd webapp dodo@membrane$ ./script/console Loading development environment. Loading IRB shuriken technique rails development>>
rails development>> script/generate controller skinny info
exists app/controllers/
exists app/helpers/
create app/views/skinny
create test/functional/
create app/controllers/skinny_controller.rb
create test/functional/skinny_controller_test.rb
create app/helpers/skinny_helper.rb
create app/views/skinny/info.rhtml
# => true
rails development>> SkinnyController.instance_methods.index("info")
# => 175
rails development>> map controllers SkinnyController # => "app/controllers" rails development>> map c SkinnyController # => "app/controllers"
rails development>> vim skinny_controller # => "app/controllers/skinny_controller.rb"
rails development>> map views # or 'map v' Layouts Skinny/Info # => "app/views"
rails development>> svn ste '" A . A README M app/controllers/skinny_controller.rb # => "app/views"
rails development>> !uname Linux # => true
rails development>> map tests # or 'map t' Functional/SkinnyControllerTest # => "test" rails development>> rake test ...
Loading production environment.
Loading IRB shuriken technique
rails production>>
TODO
- get feedback from users
- add these commands to IRB auto-completer (readline)
- add more useful stuff, then cleanup code