(clojure-version)returns the current clojure version (clojure-version) => (contains {:major anything, :minor anything, :incremental anything :qualifier anything})
returns the current clojure version
(clojure-version)
=> (contains
{:major anything,
:minor anything,
:incremental anything
:qualifier anything})(equal? a b)compares if two versions are the same
(equal? "1.2-final" "1.2") => true
compares if two versions are the same (equal? "1.2-final" "1.2") => true
(init constraints & statements)only attempts to load the files when the minimum versions have been met
(version/init [[:java :newer {:major 1 :minor 8}] [:clojure :newer {:major 1 :minor 6}]] (:import java.time.Instant))
only attempts to load the files when the minimum versions have been met
(version/init [[:java :newer {:major 1 :minor 8}]
[:clojure :newer {:major 1 :minor 6}]]
(:import java.time.Instant))(java-version)returns the current java version (java-version) => (contains {:major anything, :minor anything, :incremental anything :qualifier anything})
returns the current java version
(java-version)
=> (contains
{:major anything,
:minor anything,
:incremental anything
:qualifier anything})(newer? a b)returns true if the the first argument is newer than the second
(newer? "1.2" "1.0") => true
(newer? "1.2.2" "1.0.4") => true
returns true if the the first argument is newer than the second (newer? "1.2" "1.0") => true (newer? "1.2.2" "1.0.4") => true
(not-equal? a b)returns true if first argument is not older than the second
(not-equal? "1.0" "1.0") => false
returns true if first argument is not older than the second (not-equal? "1.0" "1.0") => false
(not-newer? a b)returns true if first argument is not older than the second
(not-newer? "1.0" "1.0") => true
returns true if first argument is not older than the second (not-newer? "1.0" "1.0") => true
(not-older? a b)returns true if first argument is not older than the second
(not-older? "1.0" "1.0") => true
returns true if first argument is not older than the second (not-older? "1.0" "1.0") => true
(older? a b)returns true if first argument is older than the second
(older? "1.0-alpha" "1.0-beta") => true
(older? "1.0-rc1" "1.0") => true
returns true if first argument is older than the second (older? "1.0-alpha" "1.0-beta") => true (older? "1.0-rc1" "1.0") => true
(parse s)parses a version input (parse "1.0.0-final") => {:major 1, :minor 0, :incremental 0, :qualifier 6, :release "final", :build ""}
(parse "1.0.0-alpha+build.123") => {:major 1, :minor 0, :incremental 0, :qualifier 0, :release "alpha", :build "build.123"}
parses a version input
(parse "1.0.0-final")
=> {:major 1, :minor 0, :incremental 0, :qualifier 6, :release "final", :build ""}
(parse "1.0.0-alpha+build.123")
=> {:major 1,
:minor 0,
:incremental 0,
:qualifier 0,
:release "alpha",
:build "build.123"}(parse-number s)parse a number from string input
(parse-number "1") => 1
parse a number from string input (parse-number "1") => 1
(parse-qualifier release build)parses a qualifier from string input
(parse-qualifier "" "") => 6
(parse-qualifier "alpha" "") => 0
parses a qualifier from string input (parse-qualifier "" "") => 6 (parse-qualifier "alpha" "") => 0
(run constraints & body)only runs the following code is the minimum versions have been met
(version/run [[:java :newer {:major 1 :minor 8}] [:clojure :newer {:major 1 :minor 6}]] (Instant/ofEpochMilli 0))
only runs the following code is the minimum versions have been met
(version/run [[:java :newer {:major 1 :minor 8}]
[:clojure :newer {:major 1 :minor 6}]]
(Instant/ofEpochMilli 0))(satisfied [type compare constraint :as entry])(satisfied [type compare constraint] current)checks to see if the current version satisfies the given constraints (satisfied [:java :newer {:major 1 :minor 7}] {:major 1 :minor 8}) => true
(satisfied [:java :older {:major 1 :minor 7}] {:major 1 :minor 7}) => false
(satisfied [:java :not-newer {:major 12 :minor 0}]) => true
checks to see if the current version satisfies the given constraints
(satisfied [:java :newer {:major 1 :minor 7}]
{:major 1 :minor 8})
=> true
(satisfied [:java :older {:major 1 :minor 7}]
{:major 1 :minor 7})
=> false
(satisfied [:java :not-newer {:major 12 :minor 0}])
=> true(system-version tag)alternate way of getting clojure and java version (system-version :clojure) => (clojure-version)
(system-version :java) => (java-version)
alternate way of getting clojure and java version (system-version :clojure) => (clojure-version) (system-version :java) => (java-version)
(version x)like parse but also accepts maps
(version "1.0-RC5") => {:major 1, :minor 0, :incremental nil, :qualifier 3, :release "rc5", :build ""}
like parse but also accepts maps
(version "1.0-RC5")
=> {:major 1, :minor 0, :incremental nil, :qualifier 3, :release "rc5", :build ""}cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |