public
Description: My dotfiles
Homepage:
Clone URL: git://github.com/zachinglis/dotfiles.git
Zach Inglis (author)
Sat Oct 03 12:41:04 -0700 2009
dotfiles / .irbrc
100644 42 lines (35 sloc) 0.886 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/ruby
IRB.conf[:AUTO_INDENT] = true
IRB.conf[:USE_READLINE] = true
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb_history"
IRB.conf[:PROMPT_MODE] = :SIMPLE
 
require 'irb/completion'
require 'irb/ext/save-history'
require 'pp'
 
# add ~/.ruby to the library search path
$LOAD_PATH << File.expand_path('~/.ruby')
 
# load rubygems and wirble
require 'rubygems' rescue nil
require 'wirble'
 
# load wirble
Wirble.init
Wirble.colorize
 
class Object
  # print documentation
  #
  # ri 'Array#pop'
  # Array.ri
  # Array.ri :pop
  # arr.ri :pop
  def ri(method = nil)
    unless method && method =~ /^[A-Z]/ # if class isn't specified
      klass = self.kind_of?(Class) ? name : self.class.name
      method = [klass, method].compact.join('#')
    end
    puts `ri '#{method}'`
  end
  
  def non_class_methods
    self.methods - Class.methods
  end
end