Liking cljdoc? Tell your friends :D

hara.core.version


+lookup+clj


+order+clj


+pattern+clj


+qualifiers+clj


clojure-versionclj

(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})
raw docstring

equal?clj

(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
raw docstring

initcljmacro

(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))
raw docstring

java-versionclj

(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})
raw docstring

newer?clj

(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
raw docstring

not-equal?clj

(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
raw docstring

not-newer?clj

(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
raw docstring

not-older?clj

(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
raw docstring

older?clj

(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
raw docstring

orderclj


parseclj

(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"}
raw docstring

parse-numberclj

(parse-number s)

parse a number from string input

(parse-number "1") => 1

parse a number from string input

(parse-number "1") => 1
raw docstring

parse-qualifierclj

(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
raw docstring

runcljmacro

(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))
raw docstring

satisfiedclj

(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
raw docstring

system-versionclj

(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)
raw docstring

versionclj

(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 ""}
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close