From 0d1737fb2ab52cf56ddf2146e5ff910dfc66d7b4 Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Sun, 12 Jul 2020 10:37:34 +0200
Subject: Modernize the module
---
lib/Config/Parser/toml.rakumod | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 lib/Config/Parser/toml.rakumod
(limited to 'lib/Config/Parser/toml.rakumod')
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;
+}
--
cgit v1.1