summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2020-07-12 10:37:34 +0200
committerPatrick Spek <p.spek@tyil.nl>2020-07-12 10:37:34 +0200
commit0d1737fb2ab52cf56ddf2146e5ff910dfc66d7b4 (patch)
tree2101379f64cf4b922b604ce847e72f4d207317c7 /lib
parent5bb23ec4cd01cafa5b8a5a8db0b038376099a956 (diff)
downloadConfig::Parser::toml-0d1737fb2ab52cf56ddf2146e5ff910dfc66d7b4.tar.gz
Config::Parser::toml-0d1737fb2ab52cf56ddf2146e5ff910dfc66d7b4.tar.bz2
Modernize the modulev1.0.1
Diffstat (limited to 'lib')
-rw-r--r--lib/Config/Parser/toml.pm621
-rw-r--r--lib/Config/Parser/toml.rakumod20
2 files changed, 20 insertions, 21 deletions
diff --git a/lib/Config/Parser/toml.pm6 b/lib/Config/Parser/toml.pm6
deleted file mode 100644
index 7d63593..0000000
--- a/lib/Config/Parser/toml.pm6
+++ /dev/null
@@ -1,21 +0,0 @@
-#! /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;
- }
-}
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;
+}