elixir-lang/elixir — pull request #1130 by meh (2013-05-28 16:49:11+00:00)
Title: Implement Mix.Version

Here we go, there are some differences from the proposed API in #1115.

* `Mix.Version.match?/2` is used to match a version specification with the passed version, if there are issues parsing the specification or the version, it raises an exception
* instead of `Mix.Version.compile/1` there's `Mix.Version.Specification.parse/1`, this is because I can implement `to_binary` and `inspect` for both `Mix.Version` and `Mix.Version.Specification`, it shouldn't be used by hand normally anyway
* There are various other public functions in `Mix.Version`, for instance `semver?/1`, `major/1`, `minor/1`, `patch/1`, `extra/1` and `to_tuple/1`.
* There are various public functions in `Mix.Version.Specification`, for instance `parse/1` and `match?/2`, the latter is the one called by `Mix.Version.match?/2` with the unwrapped version value.
* Currently `1.0` is greater than `1.0.0`, this is because my life is easier this way, given `nil` is always greater than numbers, if this is a problem I can change it tho.

The doc might need some added examples, but I want feedback on the code first given the usage might change.

Feedbacks, corrections, anything, let them come.