TIP: Ruby, IRB Auto-Complete
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.
include said,
May 20, 2008 @ 7:42 pm
nice add is:
require ‘rubygems’
require ‘wirble’
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
Wirble.init
Wirble.colorize
to get colors on it
Vidul said,
June 9, 2009 @ 4:54 am
Thanks, both the post and the comment help a lot!
include said,
June 9, 2009 @ 9:03 am
Thanks @Vidul
MetalElf0 said,
June 24, 2009 @ 7:57 am
Thanks for the post, really helpful!