Liking cljdoc? Tell your friends :D

zensols.actioncli.resource

A file system/resource configuration package.

A file system/resource configuration package.
raw docstring

*resource-paths*clj

Meant for this namespace internal use only.

Meant for this namespace internal use only.
raw docstring

register-resourceclj

(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.

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

resource-pathclj

(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.

Keys

  • :create if :file then create the director(ies) on the file system, otherwise if :dir then create all parent directories
Get 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
raw docstring

set-resource-property-formatclj

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

with-resourcescljmacro

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

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

× close