Exit Wiki

Ruby's a pretty populate language that we've worked a lot with over the past years.

Debugging Tips

Ruby-Debug is your friend

Debugger.post_mortem do  
  block
end

Will do a post mortem if the block throws an exception. (Debugger.post_mortem by itself does this, but if say this is part of a Rake task you are better off using the block version of this -- rake has a lot of internal catches to prevent exceptions going out, and is hard to retrofit so the global variant of this function works).

Getting Variables and values in the scope where an exception was raised

See this answer on StackOverflow.com for a ton of code to answer this question

Open Classes are your enemy

* How To Find Where A Method Is Defined

Multiple Version Of Ruby

Multiple Versions of Ruby (with version chooser menu shell script)

OR, a real tool to do it...

The Dr Nic approved way...

AND THEN READ how to get Rubygems up with this new Ruby...

Documenting Ruby

Comments are a code smell

Places where you should use comments

Comments Should

Summary

Comments:

Add comments by visiting: Ruby/Comments

Ruby (last edited 2010-04-21 20:09:09 by RyanWilcox)