The Fugue

Counterpoint by Hans Fugal

~/.irbrc

Posted by Hans Fugal Thu, 20 Apr 2006 18:33:24 GMT

I don't know whether to be jumping for joy or throwing things across the room for living without this knowledge for so long.

~/.irbrc is a really nifty file. I should take the time to explore its possibilities sometime. But where does one find out the irb tricks like that one, and this one? If you know please enlighten us!

Here's my current ~/.irbrc:

IRB.conf[:AUTO_INDENT]=true

# ri
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}` 
      end 
    else 
      puts `ri #{self}` 
    end 
  end 
end

# vim: filetype=ruby

Posted in | no comments | Tags , , , | atom

Comments

Leave a response

Leave a comment