jameskilton (owner)

Revisions

gist: 179116 Download_button fork
public
Public Clone URL: git://gist.github.com/179116.git
Embed All Files: show embed
Ruby #
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
#!/usr/bin/env ruby
 
require 'irb/completion'
require 'irb/ext/save-history'
 
require 'rubygems'
require 'wirble'
 
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
 
# History
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
 
# Eval history, get the last value with _
IRB.conf[:EVAL_HISTORY] = 1000
IRB.conf[:SAVE_HISTORY] = 100
 
Wirble.init
Wirble.colorize
 
def bench(n=1e3,&b)
  a=Time.now
  n.to_i.times(&b)
  Time.now-a
end