IRB Recipes
Yesterday we had an interesting Selenium Ruby session with Exist QA group. We were divided into 2 groups and my team was tasked to create IRB recipes for the following scenarios:
- enable auto-indenting
- enable auto-complete
- add a clear screen method (clear or cls)
Auto indenting
- enables user to write clean and properly indented codes.

IRB auto-indent configuration
1. From your console fire up your IRB
2. Notice that if you type ‘conf’ and check for the default value of
conf = false
3. To override this, type
conf = true (see line 2)
Auto complete
- enables user to check the available methods within an object by clicking DOUBLE TAB

IRB auto-complete configuration
1. From your console fire up your IRB
2. Type below command inside your IRB
require ‘irb/completion’
Clear Screen
- enables user clear the screen inside the IRB

IRB clear screen method
1. From your console fire up your IRB
2. Define a method to clear the system (see line 2-4)
3. Now you can call the method ‘cls’ inside IRB that will clear your screen
-
February 20, 2009 at 12:37 pm | #1Using .irbrc file to configure your IRB « .. Library of WONDERS ..
Recent Comments