3 Parses libarian-puppet's Puppetfile format
5 Author: Raphael Pinson <raphael.pinson@camptocamp.com>
8 See https://github.com/rodjek/librarian-puppet
11 This file is licenced under the LGPL v2+, like the rest of Augeas.
16 About: Configuration files
17 This lens applies to Puppetfiles.
20 The <Test_Puppetfile> file contains various examples and tests.
26 a comma, optionally preceded or followed by spaces or newlines *)
27 let comma = del /[ \t\n]*,[ \t\n]*/ ", "
30 The moduledir setting specifies where modules from the Puppetfile will be installed *)
31 let moduledir = [ Util.indent . key "moduledir" . Sep.space . Quote.any . Util.eol ]
35 let forge = [ Util.indent . key "forge" . Sep.space . Quote.any . Util.eol ]
39 let metadata = [ Util.indent . key "metadata" . Util.eol ]
42 a module entry, with optional version and options *)
44 let mod_name = Quote.do_quote (store ((Rx.word . /[\/-]/)? . Rx.word))
45 in let version = [ label "@version" . Quote.do_quote (store /[^:\n]+/) ]
46 in let opt = [ Util.del_str ":" . key Rx.word . del /[ \t]*=>[ \t]*/ " => "
47 . Quote.do_quote (store /[^,\n]*/) ]
48 in let opts = Build.opt_list opt comma
49 in [ Util.indent . Util.del_str "mod" . seq "mod" . Sep.space . mod_name
55 the Puppetfile lens *)
56 let lns = (Util.empty | Util.comment | forge | metadata | mod | moduledir )*