webmat (owner)

Revisions

gist: 27603 Download_button fork
public
Public Clone URL: git://gist.github.com/27603.git
Embed All Files: show embed
Text #
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
# IRB prompt that looks like code samples
IRB.conf[:USE_READLINE] = true
IRB.conf[:AUTO_INDENT] = false
 
my_conf = IRB.conf[:PROMPT][:COPY] = {}
my_conf[:PROMPT_N] = ""
my_conf[:PROMPT_S] = ""
my_conf[:PROMPT_I] = ""
my_conf[:PROMPT_C] = ""
my_conf[:RETURN] = "#=> %s\n\n"
IRB.conf[:PROMPT_MODE] = :COPY
 
#Following is an exact copy/paste of a few commands run from IRB
=begin
 
a = [:bleh, :foo, 'bar']
#=> [:bleh, :foo, "bar"]
 
a.reject{|e| e.is_a? Symbol}
#=> ["bar"]
 
5**4
#=> 625
 
=end