Yakaz is proud to publish yamerl, a YAML 1.2 parser, written in pure Erlang.
YAML is a human friendly data serialization format. You may find the specifications on the Official YAML web site. For a more general overview, see the YAML Wikipedia artcle.
yamerl is able to parse YAML 1.1 and YAML 1.2, as well as JSON. Documents can come from in-memory strings, files or streams, for which the developer is responsible for feeding the parser with chunks of data.
Besides standard node types, Erlang-specific types are supported by:
- Erlang atoms, with the ability to autodetect them,
- Erlang fun().
yamerl is distributed under the terms of the 2-clause BSD license. Code, documentation and testsuite are available from Github: https://github.com/yakaz/yamerl.
The files to make a Debian package are also available in this same repository. A FreeBSD port will follow soon.
I am creating a rails 3 gem for seotmhing similar to this today. It will allow you to add yaml config files to a top-level rails directory called yapp_config' and will automatically make the constants available to your app when you start the server. You can then access the constants using a namespace of the config file which will be camel cased. For instance, if you added user_contants.yml and app_constants.yml, you could access the constants by doing this:YappConfig::UserConstants.SOME_CONSTANTYappConfig::AppConstants.SOME_OTHER_CONSTANTHopefully I will get this posted to github and my blog later this afternoon.
Posted by: Korn | 12/28/2012 at 11:00 AM