aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2017-04-27 14:53:13 +0200
committerPatrick Spek <p.spek@tyil.nl>2017-04-27 14:53:13 +0200
commitb366ef7066f63df2e19bd93e34de202f34a1c282 (patch)
treeb05a1017ca725e6d8f429836f6d76a3e7085ec42 /lib
Initial commit
Diffstat (limited to 'lib')
-rw-r--r--lib/Config/Parser/toml.pm621
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/Config/Parser/toml.pm6 b/lib/Config/Parser/toml.pm6
new file mode 100644
index 0000000..7d63593
--- /dev/null
+++ b/lib/Config/Parser/toml.pm6
@@ -0,0 +1,21 @@
+#! /usr/bin/env false
+
+use v6.c;
+
+use Config::Parser;
+use Config::TOML;
+
+class Config::Parser::toml is Config::Parser
+{
+ method read(Str $path --> Hash)
+ {
+ from-toml(slurp $path);
+ }
+
+ method write(Str $path, Hash $config --> Bool)
+ {
+ spurt $path, to-toml($config);
+
+ True;
+ }
+}