Document version-clj as a library that works with babashka (#568)

* Document version-clj as a library that works with babashka

The `use` syntax relies on resolution of #565

* Switch to loading version-clj via require

In bb version <= 0.2.0 `use` does not work with `version-clj.core`,
so the example now provides usage that works with older versions of bb.
This commit is contained in:
Lee Read 2020-09-09 14:25:38 -04:00 committed by GitHub
parent e7946d1d55
commit 43a1634d3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -261,6 +261,26 @@ A clojure tool to navigate through your data. This example will launch a browser
$ cat deps.edn | bb -cp `clojure -Spath -Sdeps '{:deps {djblue/portal {:mvn/version "0.4.1"}}}'` -m portal.main edn
```
### [version-clj](https://github.com/xsc/version-clj)
Analysis and comparison of artifact version numbers.
``` clojure
> export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {version-clj/version-clj {:mvn/version "0.1.2"}}}')
> bb --repl
...
user=> (require '[version-clj.core :as ver])
nil
user=> (ver/version->seq "1.0.0-SNAPSHOT")
[(1 0 0) ["snapshot"]]
user=> (ver/version-compare "1.2.3" "1.0.0")
1
user=> (ver/version-compare "1.0.0-SNAPSHOT" "1.0.0")
-1
user=> (ver/version-compare "1.0" "1.0.0")
0
```
## Pods
[Babashka pods](https://github.com/babashka/babashka.pods) are programs that can