Trying to debug your Ruby or Rails code? Using “puts” but having trouble digging your debugging output from the log? Make your debugging more prominent with puts_pyramid!
puts “foo”:
foo # This is stupid and easy to lose!
puts_pyramid “foo”:
*
**
***
foo # This is easy to find!
***
**
*
If the default pyramid is still too small, pass in an optional height argument:
puts_pyramid “foo”, 10:
*
**
***
****
*****
******
*******
********
*********
**********
foo
**********
*********
********
*******
******
*****
****
***
**
*