[augeas-devel] augeas: master - Lens and tests for DarkIce
David Lutterkort
lutter at fedoraproject.org
Mon Feb 2 22:40:46 UTC 2009
Gitweb: http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=a9b30edca5608532b3ef3c426b2348a9e20b8f46
Commit: a9b30edca5608532b3ef3c426b2348a9e20b8f46
Parent: cca1376bd52708eb5107cae6c4be8b4373cc10e8
Author: Free Ekanayaka <free at 64studio.com>
AuthorDate: Mon Feb 2 14:39:49 2009 -0800
Committer: David Lutterkort <lutter at redhat.com>
CommitterDate: Mon Feb 2 14:39:49 2009 -0800
Lens and tests for DarkIce
See http://darkice.tyrell.hu/
---
lenses/darkice.aug | 30 ++++++++++++++++++++++++++++++
lenses/tests/test_darkice.aug | 24 ++++++++++++++++++++++++
2 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/lenses/darkice.aug b/lenses/darkice.aug
new file mode 100644
index 0000000..e8f0873
--- /dev/null
+++ b/lenses/darkice.aug
@@ -0,0 +1,30 @@
+(* Darkice module for Augeas
+ Author: Free Ekanayaka <free at 64studio.com>
+
+ Reference: man 5 darkice.cfg
+*)
+
+
+module Darkice =
+ autoload xfm
+
+
+(************************************************************************
+ * INI File settings
+ *************************************************************************)
+let comment = IniFile.comment IniFile.comment_re IniFile.comment_default
+
+let sep = IniFile.sep IniFile.sep_re IniFile.sep_default
+
+let entry_re = ( /[A-Za-z0-9][A-Za-z0-9\._-]*/ )
+let entry = IniFile.entry entry_re sep comment
+
+let title = IniFile.title_label "target" IniFile.record_label_re
+let record = IniFile.record title entry
+
+let lns = IniFile.lns record comment
+
+let filter = (incl "/etc/darkice.cfg")
+ . Util.stdexcl
+
+let xfm = transform lns filter
diff --git a/lenses/tests/test_darkice.aug b/lenses/tests/test_darkice.aug
new file mode 100644
index 0000000..41fbc60
--- /dev/null
+++ b/lenses/tests/test_darkice.aug
@@ -0,0 +1,24 @@
+module Test_darkice =
+
+ let conf = "# this is a comment
+
+[general]
+duration = 0
+bufferSecs = 5 # size of internal slip buffer, in seconds
+
+[icecast2-0]
+bitrateMode=cbr
+format = vorbis
+"
+
+ test Darkice.lns get conf =
+ { "#comment" = "this is a comment" }
+ {}
+ { "target" = "general"
+ { "duration" = "0" }
+ { "bufferSecs" = "5"
+ { "#comment" = "size of internal slip buffer, in seconds" } }
+ {} }
+ { "target" = "icecast2-0"
+ { "bitrateMode" = "cbr" }
+ { "format" = "vorbis" } }
More information about the augeas-devel
mailing list