Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/carica/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
[clojure.tools.logging :as log]
[clojure.tools.reader :as clj-reader]
[clojure.tools.reader.edn :as edn]
[clojure.walk :as walk]))
[clojure.walk :as walk])
(:import [java.net URL]))

(declare config)

Expand Down Expand Up @@ -50,7 +51,7 @@
(fn [resource]
(->> (if (string? resource)
resource
(.getPath resource))
(.getPath ^URL resource))
(re-find #"\.([^..]*?)$")
second
(keyword "carica"))))
Expand All @@ -61,7 +62,7 @@
(defmethod load-config :carica/clj [resource]
(load-with resource clj-reader/read))

(defmethod load-config :carica/json [resource]
(defmethod load-config :carica/json [^URL resource]
(with-open [s (.openStream resource)]
(-> s io/reader (json-parse-stream true))))

Expand Down