From 640dc5f8da3e42aa4d82aba450bcacd82046caf6 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Fri, 12 Jul 2019 11:42:23 +0200 Subject: Attempt to allow IO::Path for path based arguments --- lib/Config/Parser/NULL.pm6 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'lib/Config/Parser') diff --git a/lib/Config/Parser/NULL.pm6 b/lib/Config/Parser/NULL.pm6 index 5113043..2352cfc 100644 --- a/lib/Config/Parser/NULL.pm6 +++ b/lib/Config/Parser/NULL.pm6 @@ -12,11 +12,16 @@ class Config::Parser::NULL is Config::Parser my %mock-config = (); #| Return the mock config, skipping the file entirely. - method read(Str $path --> Hash) + multi method read(Str $path --> Hash) { %mock-config; } + multi method read(IO::Path $path --> Hash) + { + %mock-config; + } + #| Set the mock config to return on read. method set-config(Hash $config) { @@ -24,7 +29,12 @@ class Config::Parser::NULL is Config::Parser } #| Return True, as if writing succeeded. - method write(Str $path, Hash $config --> Bool) + multi method write(Str $path, Hash $config --> Bool) + { + True; + } + + multi method write(IO::Path $path, Hash $config --> Bool) { True; } -- cgit v1.1