(classify-dir-entries dir)
Looks for all Clojure (.clj) files in the directory tree rooted at dir
, a string.
Returns a seq of maps.
Each map will contain one of four values for the :status
key:
:contains-namespace (The namespace is the value of key :namespace-symbol
.)
:unreadable
:no-namespace (There is no ns
form.)
:broken-namespace (An ns
entry in the file is malformed.)
The original java.io.File object is under key :file
.
Looks for all Clojure (.clj) files in the directory tree rooted at `dir`, a string. Returns a seq of maps. Each map will contain one of four values for the `:status` key: :contains-namespace (The namespace is the value of key `:namespace-symbol`.) :unreadable :no-namespace (There is no `ns` form.) :broken-namespace (An `ns` entry in the file is malformed.) The original java.io.File object is under key `:file`.
(classpath-files)
(classpath-files classloader)
Returns a sequence of File objects of the elements on the classpath.
Returns a sequence of File objects of the elements on the classpath.
(file->namespaces prefix f)
Map a classpath file to the namespaces it contains. prefix
allows for
reducing the namespace search space. For large directories on the classpath,
passing a prefix
can provide significant efficiency gains.
Map a classpath file to the namespaces it contains. `prefix` allows for reducing the namespace search space. For large directories on the classpath, passing a `prefix` can provide significant efficiency gains.
(filter-by-prefix namespaces prefix)
Given a list of namespaces, retain only those whose names
begin with the given prefix. A nil
prefix means everything
is to be retained.
Given a list of namespaces, retain only those whose names begin with the given prefix. A `nil` prefix means everything is to be retained.
(loader-classpath loader)
Returns a sequence of File objects from a classloader.
Returns a sequence of File objects from a classloader.
(namespaces-in-dir dir)
Return a seq of all namespaces found in Clojure source files in dir.
Return a seq of all namespaces found in Clojure source files in dir.
(namespaces-on-classpath &
{:keys [prefix classpath]
:or {classpath (classpath-files)}})
Return symbols of all namespaces matching the given prefix both on disk and inside jar files. If :prefix is passed, only return namespaces that begin with this prefix. If :classpath is passed, it should be a seq of File objects or a classpath string. If it is not passed, default to java.class.path and the current classloader, assuming it is a dynamic classloader.
Return symbols of all namespaces matching the given prefix both on disk and inside jar files. If :prefix is passed, only return namespaces that begin with this prefix. If :classpath is passed, it should be a seq of File objects or a classpath string. If it is not passed, default to java.class.path and the current classloader, assuming it is a dynamic classloader.
(path-for namespace)
Transform a namespace into a .clj file path relative to classpath root.
Transform a namespace into a .clj file path relative to classpath root.
(select-subdirectory dir namespace)
dir
is the root of a directory hierarchy. Branches (subdirectories)
of that hierarchy are described in Clojure namespace notation. The branch
so described is returned as a ^File.
A nil
namespace or empty string means the entire hierarchy.
Example: (extend-directory-with-namespace (io/file ".") "a.b-test") => (io/file "./a/b_test")
`dir` is the root of a directory hierarchy. Branches (subdirectories) of that hierarchy are described in Clojure namespace notation. The branch so described is returned as a ^File. A `nil` namespace or empty string means the entire hierarchy. Example: (extend-directory-with-namespace (io/file ".") "a.b-test") => (io/file "./a/b_test")
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close