Liking cljdoc? Tell your friends :D

hara.io.file.walk


match-filterclj

(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
raw docstring

match-singleclj

(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
raw docstring

visit-directory-postclj

(visit-directory-post m)

helper function, triggers after visiting a directory

helper function, triggers after visiting a directory
raw docstring

visit-directory-preclj

(visit-directory-pre {:keys [root path attrs accumulate] :as m})

helper function, triggers before visiting a directory

helper function, triggers before visiting a directory
raw docstring

visit-fileclj

(visit-file {:keys [path attrs accumulate] :as m})

helper function, triggers on visiting a file

helper function, triggers on visiting a file
raw docstring

visit-file-failedclj

(visit-file-failed m)

helper function, triggers on after a file cannot be visited

helper function, triggers on after a file cannot be visited
raw docstring

visitorclj

(visitor m)

contructs the clojure wrapper for java.nio.file.FileVisitor

contructs the clojure wrapper for `java.nio.file.FileVisitor`
raw docstring

walkclj

(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 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 attrs))))})
=> map?
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close