https://github.com/devth/cyg
Minimalist config for Clojure
https://github.com/devth/cyg
Last synced: 10 months ago
JSON representation
Minimalist config for Clojure
- Host: GitHub
- URL: https://github.com/devth/cyg
- Owner: devth
- License: epl-1.0
- Created: 2014-03-20T12:48:29.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-03-20T13:50:55.000Z (almost 12 years ago)
- Last Synced: 2025-02-02T15:32:35.355Z (11 months ago)
- Language: Clojure
- Size: 156 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cyg
Minimalist configuration. Expects a `config.edn` or `config.clj` path to be
available as a resource. Use Leiningen profiles to specify how config gets on
the resource paths.
**Warning**: wet paint.
```clojure
[cyg "0.1.4"]
```
## Usage
```clojure
(require '[cyg.core :refer [cf]])
(if-let [qux (cf :foo :bar :baz :qux)]
(println "found config" qux")
(println "config is not set"))
```
With this configuration on resource path:
```
;; config.edn
{:foo {:bar {:baz {:qux "hi cyg!"}}}}
```
The above example would print `hi cyg`.
## Auto reload
By default, config is only loaded once on startup. If you'd like to enable
auto-reload (useful during dev), run:
```clojure
(cyg.core/autoreload!)
```
## TODO
- A companion lein plugin to help with config setup.
- By default, cyg should setup `config/:profile` resource-paths for `dev`
and `prod`, so if you place `config.edn` at `config/dev/config.edn` cyg will
load it when the Leiningen `dev` profile is active.
## License
Copyright © 2014 Trevor Hartman
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.