A file system/resource configuration package.
A file system/resource configuration package.
Meant for this namespace internal use only.
Meant for this namespace internal use only.
(register-resource key
&
{:keys [function pre-path constant type system-file
system-property system-default]
:or {type :file}})
Register a resource to be used with resource-path
.
This should be done at the beginning of the program, usually from core
.
key: the key to be used for the resource with resource-path
.
All keys are optional but at least :function or :system-file must be provided.
:resource
or :file
(default)set-resource-property-format
)Register a resource to be used with [[resource-path]]. This should be done at the beginning of the program, usually from `core`. **key**: the key to be used for the resource with [[resource-path]]. ## Keys All keys are optional but at least :function or :system-file must be provided. * **:function** the function to call when the resource is generated (see the [resource test](https://github.com/plandes/clj-actioncli/blob/master/test/zensols/actioncli/resource_test.clj) and example of how to use this) * **:type** the type of resource to return; one of `:resource` or `:file` (default) * **:pre-path** a key of a resource to prepend to the path * **:system-file** a file path of the resource--if the same name exists as a system property then that is used instead (see [[set-resource-property-format]]) * **:system-default** the default path to use if the system-file isn't found in the system properties * **:system-property** get the resource directly from the system properties
(resource-path key)
(resource-path key child-file & {:keys [create] :or {create nil}})
Get a path to a resource.
Before using this you must register resources with register-resource
.
:file
then create the director(ies) on the
file system, otherwise if :dir
then create all parent directoriesGet a path to a resource. Before using this you must register resources with [[register-resource]]. ## Keys * **:create** if `:file` then create the director(ies) on the file system, otherwise if `:dir` then create all parent directories
(set-resource-property-format fmt-str)
The format string (used with format
) to generate the system property for
resource string lookups in the system properties.
The format string (used with `format`) to generate the system property for resource string lookups in the system properties.
(with-resources & forms)
Allows for temporal registration and path rendering in a lexical context.
Allows for temporal registration and path rendering in a lexical context.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close