aboutsummaryrefslogtreecommitdiff
path: root/lib/Config/Parser/toml.pm6
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Config/Parser/toml.pm6')
-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;
+ }
+}