c3d2-wiki/Irb.mw

28 lines
401 B
Plaintext

=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>