anildigital / dotfiles

dotfiles of my macbook

This URL has Read+Write access

dotfiles / irbrc
100644 30 lines (23 sloc) 0.528 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
#def time(times = 1)
# require 'benchmark'
# ret = nil
# Benchmark.bm {|x| x.report {times.times {ret = yield }}}
#end
require 'rubygems'
require 'utility_belt'
require 'wirble'
Wirble.init
Wirble.colorize
 
UtilityBelt.equip(:all)
 
def log_to(stream=STDOUT)
  ActiveRecord::Base.logger = Logger.new(stream)
  ActiveRecord::Base.clear_active_connections!
end
 
 
# Easily print methods local to an object's class
class Object
  def local_methods
    (methods - Object.instance_methods).sort
  end
end
 
 
# q as exit
alias q exit