technomancy/leiningen — pull request #1640 by phalphalak (2014-08-13 12:36:19+00:00)
Title: Extract version parsing function out of parse-semantic-version.

I've noticed that `leiningen.release/parse-semantic-version` aborts in case it fails to parse the arg string. (The doc string claims to throw an exception instead, btw). It is a pity the code would have to be duplicated in a plugin code or wrapped into something like this if one was to eschew abortion:

```clojure
(binding [leiningen.core.main/*exit-process?* false *err* (java.io.StringWriter.)]
...)
```

I would like to suggest to decouple the abort and parsing of the version-string. I've created a pull request as a sketch. I'm not happy with the naming I came up with (any suggestions?). It might be preferable to change the name of the original `parse-semantic-version` fn to something that reflects that it will abort in case of a failure while the suggested function `string->semantic-version` should rather be named `parse-semantic-version`. However for compatibility reasons I've refrained from renaming it.