File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,18 +62,17 @@ You can also take a look at a [comprehensive comparison](http://time4j.net/tutor
6262
6363## Usage
6464
65- Add the following dependency to your ` deps.edn `
65+ Add the following dependency to your ` deps.edn ` :
6666``` clj
6767clojure.java-time/clojure.java-time {:mvn/version " 1.0.0" }
6868```
6969
7070or to your ` project.clj ` or ` build.boot ` :
71-
7271``` clj
7372[clojure.java-time " 1.0.0" ]
7473```
7574
76- The [ API] ( https://dm3.github.io/clojure.java-time/ ) of the Clojure.Java-Time
75+ The [ API] ( https://dm3.github.io/clojure.java-time ) of the Clojure.Java-Time
7776consists of one namespace, namely ` java-time.api ` . For the purposes of this guide,
7877we will ` require ` the main namespace:
7978
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bb
2+ (ns sync-readme-version
3+ (:require [clojure.string :as str]))
4+
5+ (def project-version-prefix " (defproject clojure.java-time \" " )
6+ (def project-version-suffix " \" " )
7+ (def project-version (some #(when (and (str/starts-with? % project-version-prefix)
8+ (str/ends-with? % project-version-suffix))
9+ (subs % (count project-version-prefix) (- (count %) (count project-version-suffix))))
10+ (str/split-lines (slurp " project.clj" ))))
11+ (assert project-version " Could not determine project version" )
12+ (def replace-version-around
13+ (volatile!
14+ #{{:prefix " clojure.java-time/clojure.java-time {:mvn/version \" "
15+ :suffix " \" }" }
16+ {:prefix " [clojure.java-time \" "
17+ :suffix " \" ]" }}))
18+ (spit " README.md"
19+ (str/join " \n "
20+ (map (fn [s]
21+ (if-some [matching (first (filter #(and (str/starts-with? s (:prefix %))
22+ (str/ends-with? s (:suffix %)))
23+ @replace-version-around))]
24+ (do (vswap! replace-version-around disj matching)
25+ (str (:prefix matching) project-version (:suffix matching)))
26+ s))
27+ (str/split-lines (slurp " README.md" )))))
28+ (assert (empty? @replace-version-around)
29+ (str " Failed to replace: " @replace-version-around))
Original file line number Diff line number Diff line change 1818 :username :env/clojars_user
1919 :password :env/clojars_token
2020 :sign-releases false }]]
21+ :plugins [[lein-codox " 0.10.8" ]
22+ [lein-shell " 0.5.0" ]
23+ [jonase/eastwood " 1.2.3" ]]
2124 :release-tasks [[" clean" ]
2225 [" vcs" " assert-committed" ]
2326 [" change" " version" " leiningen.release/bump-version" " release" ]
2427 [" doc" ]
28+ [" shell" " ./bin/sync-readme-version.clj" ]
2529 [" vcs" " commit" ]
2630 [" vcs" " tag" " --no-sign" ]
2731 [" deploy" " release" ]
3438 [org.clojure/tools.namespace " 1.3.0" ]
3539 [joda-time/joda-time ~joda-time-version]
3640 [org.threeten/threeten-extra ~threeten-extra-version]]
37- :plugins [[lein-codox " 0.10.8" ]
38- [jonase/eastwood " 1.2.3" ]]
39-
4041 :source-paths [" dev" ]
4142 :global-vars {*warn-on-reflection* true }
4243 :eastwood {:exclude-namespaces [java-time
You can’t perform that action at this time.
0 commit comments