kytrinyx/petroglyph — pull request #22 by markijbema (2013-12-28 11:24:32+00:00)
Title: Some refactoring

Hey Katrina,

I decided to check out what this pg thingy in exercism was. In trying to understand it I refactored some stuff along the way. I think some of this is very worthwhile, other changes might be more a matter of taste.

In general I have one gripe with this gem, there are several functions which take two types of parameters (for instance, a block and a hash), and fail rather silently when you do something unexpected (for instance, give both). I tried to fix this a bit, but to fix it fully you'd need to do more backwards incompatible changes (for instance, refactor the collection functionality).

As for this pull request, I would really appreciate if you'd take the time to look through the commits. Not every commit is straight forward, and some might break something. For me this has no hurry whatsoever though, so please do it whenever you have some time.