(match-filter {:keys [path attrs root include exclude with] :as m})matches according to many filters
(match-filter {}) => true
(match-filter {:root (path/path "") :path (path/path "src/hara/test.clj") :include [{:tag :pattern :pattern #"test"}]}) => true
(match-filter {:root (path/path "") :path (path/path "src/hara/test.clj") :exclude [{:tag :pattern :pattern #"test"}]}) => false
matches according to many filters
(match-filter {})
=> true
(match-filter {:root (path/path "")
:path (path/path "src/hara/test.clj")
:include [{:tag :pattern
:pattern #"test"}]})
=> true
(match-filter {:root (path/path "")
:path (path/path "src/hara/test.clj")
:exclude [{:tag :pattern
:pattern #"test"}]})
=> false(match-single {:keys [root path attrs] :as m} {:keys [tag] :as single})matches according to the defined filter
(match-single {:root (path/path ".") :path (path/path "src/hara/test.clj")} {:tag :pattern :pattern #"src"}) => true
(match-single {:root (path/path "src") :path (path/path "src/hara/test.clj")} {:tag :pattern :pattern #"src"}) => false
(match-single {:path (path/path "src/hara/test.clj")} {:tag :fn :fn (fn [m] (re-find #"hara" (str m)))}) => true
matches according to the defined filter
(match-single {:root (path/path ".")
:path (path/path "src/hara/test.clj")}
{:tag :pattern
:pattern #"src"})
=> true
(match-single {:root (path/path "src")
:path (path/path "src/hara/test.clj")}
{:tag :pattern
:pattern #"src"})
=> false
(match-single {:path (path/path "src/hara/test.clj")}
{:tag :fn
:fn (fn [m]
(re-find #"hara" (str m)))})
=> true(visit-directory-post m)helper function, triggers after visiting a directory
helper function, triggers after visiting a directory
(visit-directory-pre {:keys [root path attrs accumulate] :as m})helper function, triggers before visiting a directory
helper function, triggers before visiting a directory
(visit-file {:keys [path attrs accumulate] :as m})helper function, triggers on visiting a file
helper function, triggers on visiting a file
(visit-file-failed m)helper function, triggers on after a file cannot be visited
helper function, triggers on after a file cannot be visited
(visitor m)contructs the clojure wrapper for java.nio.file.FileVisitor
contructs the clojure wrapper for `java.nio.file.FileVisitor`
(walk root
{:keys [directory file include exclude recursive depth options accumulator
accumulate with]
:as m})visits files based on a directory
(walk "src" {:accumulate #{:directories}}) => vector?
(walk "src" {:accumulator (atom {}) :accumulate #{} :file (fn [{:keys [path attrs accumulator]}] (swap! accumulator assoc (str path) (.toMillis (.lastAccessTime ^BasicFileAttributes attrs))))}) => map?
visits files based on a directory
(walk "src" {:accumulate #{:directories}})
=> vector?
(walk "src" {:accumulator (atom {})
:accumulate #{}
:file (fn [{:keys [path attrs accumulator]}]
(swap! accumulator
assoc
(str path)
(.toMillis (.lastAccessTime ^BasicFileAttributes attrs))))})
=> map?cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |