c3d2-wiki/Irb.mw

28 lines
401 B
Plaintext
Raw Normal View History

2006-02-12 03:08:05 +01:00
=ri in irb=
<pre>
def ri arg
puts `ri #{arg}`
end
class Module
def ri(meth=nil)
if meth
if instance_methods(false).include? meth.to_s
puts `ri #{self}##{meth}`
else
super
end
else
puts `ri #{self}`
end
end
end
</pre>
=Tab completion=
<pre>
require 'irb/completion'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
</pre>