shoes/shoes4 — pull request #747 by wasnotrice (2014-06-06 03:15:20+00:00)
Title: Add #to_s and #inspect for classes that include CommonMethods

Here's a basic implementation of #to_s and #inspect. It's done as its own module, so we can include it in `CommonMethods`, which gets it into most of the classes that need it. But there are lots of classes that don't include CommonMethods, so they'll need to include the `Inspect` module too. This seems like a good idea to me, but I'm open to the possibility that it's not. I'm going for uniformity.

Here's how it stands:

rect.to_s # (Shoes:Rect) same as Shoes 3
rect.inspect # (Shoes:Rect <0x1234abcd>) adds an identifier

I'm not completely convinced of the inspect format, but I do think it's nice to be able to see whether two objects are the same, especially for spec failures.

Of course, lots of classes can/should override these methods to add useful information.

This is kind of an unorthodox pull request (pulling into a branch that is itself a pull request), but I thought I'd get the ideas out there for discussion, and I think the gems branch will be merged soon...I'll deal with the merge :wink: