0.0
No commit activity in last 3 years
No release in over 3 years
Easy to use parser for Debian Control Files.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 1.2.5
 Project Readme

treetop-dcf

Easy to use parser for Debian Control Files. The format is very similar to YAML, but with some subtle differences (e.g. YAML requires a space after field names, DCF does not).

Parsed paragraphs are returned as hashes in an array. Example:

irb(main):001:0> require "dcf"
=> true
irb(main):002:0> Dcf.parse "Attr: Value"
=> [{"Attr"=>"Value"}]

The parser is currently quite slow, so if the files you're parsing allows it I'd recommend using this YAML based parser instead: http://gist.github.com/117293 Its much faster but fails on certain valid files.

Installation

gem install treetop-dcf

Acknowledgements

This project was created during Google Summer of Code 2009, as part of my project for the R Foundation for Statistical Computing. (CRAN uses DCF for package information, and we needed a parser written in Ruby.) Therefore, a big thanks goes out to both the R Foundation and Google.

Author

Bjørn Arild Mæland <bjorn.maeland at gmail.com>