aboutsummaryrefslogtreecommitdiff
path: root/lib/Config.rakumod
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Config.rakumod')
-rw-r--r--lib/Config.rakumod13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Config.rakumod b/lib/Config.rakumod
index c987352..9e2a114 100644
--- a/lib/Config.rakumod
+++ b/lib/Config.rakumod
@@ -177,6 +177,17 @@ multi method read (
self.read(self!read-from-file($path, $parser));
}
+#| Update the Config values from a given file.
+multi method read (
+ Str:D $path,
+
+ Config::Parser:U $parser? is copy,
+
+ --> Config:D
+) {
+ self.read($path.IO, $parser)
+}
+
#| Update the Config values from a list of files.
multi method read (
#| A list of paths to configuration files to load.
@@ -193,7 +204,7 @@ multi method read (
) {
my %data = %!data;
- for @paths -> $path {
+ for @paths.map(*.IO) -> $path {
next if !$path.f && $skip-not-found;
X::Config::FileNotFound.new(:$path).throw if !$path.f;