package lilac
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
md5=40e01c5ef4289477a523ae5a46d5c95d
sha512=1d991b6115ddddf3a314edce48f6130bb6ef2faa0ad204883de5ff7ad9e29c25d112ea7a59a82aa36b34217ce53b3258100061547ab6b6c9a01edd49ab49a4cb
Description
README
lilac
lilac is a simple library for getting the value of any field in a YAML file as a string.
Summary
Take this example yaml:
lilac-params:
source:
url: "https://ttaw.dev"
user: "lilac+source@ttaw.dev"
dest:
url: "https://walkandtalk.dev"
user: "lilac+dest@walkandtalk.dev"To get the value "lilac+source@ttaw.dev", you'd specify the path lilac-params.source.user.
Here's an example of how you might do that in code with the yaml used in this project's test/res directory:
let yaml = yaml_from_fpath "test/res/config.yaml" in
yaml_value_str ~path:"lilac-params.source.user" yaml
|> Option.value ~default:"Oops! It wasn't there."lilacbin
The lilacbin app in this repo's bin/ is really just used for debugging, so it's dependencies are tagged as test only requirements in the package manifest. It does have some niceties like a --help flag, but if there's something you're interested in it doing beyond debugging, let me know! Raising an issue is my preferred channel for that kinda thing.
Dependencies
I'll start with the basics for macOS because putting this project together required I learn them too. I hope they'll serve as at least some direction for other operating systems but if you notice something important I've missed, please create an issue :heart:
First you'll need opam and ocaml.
For macOS:
brew install opambrew install ocaml
For anything else, the opam installation docs live here, and the ocaml intallation docs live here.
Once OCaml and opam are installed, run opam init from the terminal to get the environment sorted. I chose to let it modify my terminal's rc file (.zshrc) so I wouldn't have to think about it again, but that's up to you :)
Installing
If you just want to install lilac as a library and use it in your application, you can run opam install lilac. Otherwise, see the Developing section below.
Developing
Dev dependencies
For local development, I'll recommend not installing with opam beforehand. Once you've cloned the repo and have navigated into its directory, you'll want to run these commands, in this order:
opam pin .opam install . --deps-only --with-test
Building
make
Running the tests
make test
Checking code coverage
make coverage
Running lilac bin for stdout debugging / validation
make run args='-i <path to yaml file>'
For example make run args='-i test/res/config.yaml'
Dependencies (6)
Dev Dependencies (2)
-
bisect_ppx
dev & >= "2.5.0" -
ounit
with-test
Optional Dependencies
None
Used by
None
Conflicts
None
Build status
Results of building lilac with each compiler on check.ci.ocaml.org, run of against opam-repository 78c202b. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 0.1.1 (this version) | good | good | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure