Fix order of methods for posts-io and update older packages

This commit is contained in:
Charlotte Allen 2020-02-04 15:59:38 -08:00
parent 724d1e9a7f
commit ae976925fb
No known key found for this signature in database
GPG Key ID: 3A64C3A6C69860B0
2 changed files with 10 additions and 12 deletions

View File

@ -38,9 +38,6 @@
:resource-paths ["resources"]
:target-path "target/%s/"
:main ^:skip-aot shapey-shifty.core
:plugins [[lein-cljfmt "0.6.6"]]
:profiles
{:uberjar {:omit-source true
:aot :all
@ -57,6 +54,7 @@
[ring/ring-devel "1.8.0"]
[ring/ring-mock "0.4.0"]]
:plugins [[com.jakemccrary/lein-test-refresh "0.24.1"]
[lein-cljfmt "0.6.6"]
[jonase/eastwood "0.3.5"]]
:source-paths ["env/dev/clj"]

View File

@ -37,6 +37,15 @@
card (get author :card)]
(assoc post :author card)))
(defn read-post
([file]
(when (.exists file)
(-> file slurp edn/read-string assoc-author)))
([dt-path n]
(let [path (format "%s/%s/%d/%s" base-posts-path (pathmap-to-path dt-path) n post-filename)
f (io/file path)]
(read-post f))))
(defn read-all-posts
([]
(read-all-posts base-posts-path))
@ -46,12 +55,3 @@
file-seq
(filter #(.isFile %))
(map #(read-post %)))))
(defn read-post
([file]
(when (.exists file)
(-> file slurp edn/read-string assoc-author)))
([dt-path n]
(let [path (format "%s/%s/%d/%s" base-posts-path (pathmap-to-path dt-path) n post-filename)
f (io/file path)]
(read-post f))))