jlindsey/semantic — pull request #4 by perlun (2013-06-07 07:29:30+00:00)
Title: Fix prerelease sorting

Hi,

I concluded that I needed a fix for this, so I went ahead and did it myself (issue #3). The diff is arguably a bit noisy, since I had to reformat the version.rb file (because of a bug w/ lack of module specifier); it might be easier to review it locally (where you can ignore whitespace changes).

Summary of the changes done:
- Fix the comparison of build numbers (they should be ignored as far as the comparison is included).
- Added extra spec for <=> with a string parameter (this one failed because of the lack of module spec around the class)
- Rearranged the specs a bit so that we don't just call variables @v1, @v2, @v3 and @v4, but rather include the actual version numbers in the variables. This makes it much easier to verify that the specs are doing what they should.

Please review it and let me know if you feel the changes are OK as they are, or if you want it to be fixed up in either direction. Cheers. :)