SUPPORT THE SITE WITH A CLICK

Subscribe Rss:

SUPPORT THE SITE WITH A CLICK

Thursday, December 18, 2008

AutoComplete in IRB

Create/Edit the .irbrc file in your home directory (UNIX users) and add the following code:

IRB.conf[:AUTO_INDENT] = true
IRB.conf[:USE_READLINE] = true
IRB.conf[:LOAD_MODULES] = [] unless IRB.conf.key?(:LOAD_MODULES)
unless IRB.conf[:LOAD_MODULES].include?('irb/completion')
IRB.conf[:LOAD_MODULES] << 'irb/completion'
end

Now, when you are typing commands into IRB, you can hit the “tab” key and it will automatically complete the command for you or display a list of possible commands if the prefix is ambiguous.

Note:This tutorial is not my own,its from http://wiki.rubyonrails.org/rails/pages/TipsAndTricks.Thanks to the wiki.rubyrails.org