summaryrefslogtreecommitdiff
path: root/lib/Config/Parser/toml.rakumod
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Config/Parser/toml.rakumod')
-rw-r--r--lib/Config/Parser/toml.rakumod20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Config/Parser/toml.rakumod b/lib/Config/Parser/toml.rakumod
new file mode 100644
index 0000000..62fbc8c
--- /dev/null
+++ b/lib/Config/Parser/toml.rakumod
@@ -0,0 +1,20 @@
+#! /usr/bin/env false
+
+use v6.d;
+
+use Config::Parser;
+use Config::TOML;
+
+unit class Config::Parser::toml is Config::Parser;
+
+method read(IO() $path --> Hash)
+{
+ from-toml($path.slurp);
+}
+
+method write(IO() $path, Hash $config --> Bool)
+{
+ $path.spurt(to-toml($config));
+
+ True;
+}