v
ну как вариант 🙂
Size: a a a
v
T
T
MK
AC
T
AC
T
ST
(defn- find-livecheck-url
[source]
(->> (string/split-lines source)
(drop-while #(not (string/starts-with? (string/triml %) "livecheck")))
(some #(let [[label value] (string/split (string/triml %) #"\s+")]
(when (= label "url") value)))
(read-string)))
AC
T
ST
AC
livecheck
....
end
...
urlT
ST
(defn- find-livecheck-url
[source]
(->> (re-seq #".+\r?\n" source)
(drop-while #(not (string/starts-with? (string/triml %) "livecheck")))
(some #(let [[label value] (string/split (string/triml %) #"\s+")]
(when (= label "url") value)))
(read-string)))
ST
T
ST
ST
(defn- find-livecheck-url
[source]
(->> (re-seq #"\s*(\w+)\s+(.+)\r?\n" source)
(drop-while (fn [[_ label]] (not= label "livecheck")))
(some (fn [[_ label value]] (when (= label "url") value)))
(read-string)))
DL
(def replacements {#"livecheck do" "{"
#"url" ":url"
#"(?is)strategy.*" "}"})
(->> replacements
(reduce (fn [s [from to]]
(str/replace s from to))
(slurp "/tmp/livecheck.rb"))
edn/read-string
:url)