Liking cljdoc? Tell your friends :D

automaton-core.adapters.edn-utils

Edn file manipulation

Edn file manipulation
raw docstring

create-tmp-ednclj

(create-tmp-edn)

Create a temporary file directory string with edn extension

Create a temporary file directory string with edn extension
raw docstring

is-clojure-like-fileclj

(is-clojure-like-file filename)

Returns true if the file's extension is clojure like

Returns true if the file's extension is clojure like
raw docstring

read-ednclj

(read-edn edn-filename)
(read-edn edn-filename loader-fn)

Read the .edn file, Params:

  • edn-filename name of the edn file to load
  • loader-fn (Optional, default: files/read-file) a function returning the content of the file

Errors:

  • throws an exception if the file is not found
  • throws an exception if the file is a valid edn
  • file could be a string representing the name of the file to load or a (io/resource) object representing the name of the file to load
Read the `.edn` file,
Params:
* `edn-filename` name of the edn file to load
* `loader-fn` (Optional, default: files/read-file) a function returning the content of the file

Errors:
* throws an exception if the file is not found
* throws an exception if the file is a valid edn
* `file` could be a string representing the name of the file to load
or a (io/resource) object representing the name of the file to load
raw docstring

spit-ednclj

(spit-edn deps-edn-filename content)
(spit-edn edn-filename content header)

Spit the content in the edn file called deps-edn-filename. If any, the header is added at the top of the file Params:

  • edn-filename Filename
  • content What is spitted
  • header the header that is added to the content, followed by the timestamp - is automatically preceded with ;; Return the content of the file
Spit the `content` in the edn file called `deps-edn-filename`.
If any, the header is added at the top of the file
Params:
* `edn-filename` Filename
* `content` What is spitted
* `header` the header that is added to the content, followed by the timestamp - is automatically preceded with ;;
Return the content of the file
raw docstring

update-edn-contentclj

(update-edn-content edn-filename update-fn)
(update-edn-content edn-filename update-fn header)

Update the edn file content with the params-to-merge map Returns the content of the file Params:

  • edn-filename the name of the file to update
  • update-fn function updating the content (fn [edn-content] (assoc edn-content ...))
  • header optional is a string added at the top of the file Note: the content will be formatted thanks to automaton.core.adapters.code-formatter
Update the edn file content with the `params-to-merge` map
Returns the content of the file
Params:
* `edn-filename` the name of the file to update
* `update-fn` function updating the content (fn [edn-content] (assoc edn-content ...))
* `header` optional is a string added at the top of the file
Note: the content will be formatted thanks to `automaton.core.adapters.code-formatter`
raw docstring

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

× close