Skip to content

Instantly share code, notes, and snippets.

@rupakg
Last active August 30, 2015 02:54
Show Gist options
  • Save rupakg/79998 to your computer and use it in GitHub Desktop.
Save rupakg/79998 to your computer and use it in GitHub Desktop.
IRBRC settings
.irbrc for Win32
Create a file called anything you like (e.g. “_irbrc” or “irb.rc”) and place it anywhere you like (say C:\Documents and Settings\), and set that full path to the ENV variable IRBRC, e.g. C:\Documents and Settings\\_irbrc
## Libraries
require 'rubygems'
require 'irb/completion'
require 'map_by_method'
require 'what_methods'
require 'pp'
require 'wirble'
## Wirble
Wirble.init
Wirble.colorize unless Config::CONFIG['host_os'] == 'mswin32'
## Prompt
IRB.conf[:PROMPT][:CUSTOM] = {
:PROMPT_I => ">> ",
:PROMPT_S => "%l>> ",
:PROMPT_C => ".. ",
:PROMPT_N => ".. ",
:RETURN => "=> %s\n"
}
IRB.conf[:PROMPT_MODE] = :CUSTOM
IRB.conf[:AUTO_INDENT] = true
## Aliases
alias q exit
## Custom functions
# easily print methods local to an object's class
class Object
def local_methods
(methods - Object.instance_methods).sort
end
end
# clear screen
def clear
system 'clear'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment