Archive for November, 2009

Wirble on Windows

November 12th, 2009 by papillon

Wirble is a set of enhancements for Irb. Wirble enables several items mentioned on the RubyGarden “Irb Tips and Tricks” page, including tab-completion, history, and a built-in ri command, as well as colorized results and a couple other goodies. (source)

1. Install gems:

gem install wirble
gem install win32console

2. Create a new file .irbc in your home directory (where the environment variable USERPROFILE points to, e.g. c:\Documents and Settings\John) and paste the following lines:

require 'rubygems' rescue nil
require 'win32/console/ansi'
ENV['IRB_HISTORY_FILE'] = "C:/.irb_history"
require 'wirble'


(adjust the path in ENV['IRB_HISTORY_FILE'] accordingly).

3. If the HOME environment variables does not exist yet, add it in the System Properties->Advanced Tab->Environment Variables area and set it to %USERPROFILE%.

Note: ANSI color output has some issues, e.g. not updating the screen correctly after Backspace key has been pressed. Simply comment the “require win32/console/ansi” and “Wirble.colorize” lines if necessary.