Added predicate is-yaml?
This commit is contained in:
parent
bb750ac610
commit
76206a28ba
1 changed files with 7 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
(:require
|
||||
[clojure.java.io :as io]
|
||||
[clj-yaml.core :as yaml]
|
||||
[clojure.string :as cs]
|
||||
[clojure.walk]
|
||||
[orchestra.core :refer [defn-spec]]
|
||||
[dda.c4k-common.predicate :as cp]))
|
||||
|
@ -22,6 +23,12 @@
|
|||
[edn cp/map-or-seq?]
|
||||
(yaml/generate-string edn :dumper-options {:flow-style :block}))
|
||||
|
||||
(defn-spec is-yaml? boolean?
|
||||
[filename string?]
|
||||
(or
|
||||
(cs/ends-with? filename ".yaml")
|
||||
(cs/ends-with? filename ".yml")))
|
||||
|
||||
(defn dispatch-by-resource-name
|
||||
[resource]
|
||||
:clj)
|
||||
|
|
Loading…
Reference in a new issue