about summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-02-19 22:59:07 +0530
committerAndinus <andinus@nand.sh>2021-02-19 23:08:26 +0530
commitc029e07dd1fea194a674fe9dfee35e3c7a63be06 (patch)
tree96168e700c70b5d4fe2b70e473fbbfdd9dd07f64 /lib
parent151186cad17539451efe7f201c66b689d754ae1a (diff)
downloadoctans-c029e07dd1fea194a674fe9dfee35e3c7a63be06.tar.gz
Fix the sample puzzle error
It would error out when the user runs sample puzzle because we're
using $path.IO.f but that wasn't passed.

It prints this error:

    Invocant of method 'f' must be an object instance of type
    'IO::Path', not a type object of type 'IO::Path'.
Diffstat (limited to 'lib')
-rw-r--r--lib/Octans/CLI.rakumod10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Octans/CLI.rakumod b/lib/Octans/CLI.rakumod
index 8abfef8..4522571 100644
--- a/lib/Octans/CLI.rakumod
+++ b/lib/Octans/CLI.rakumod
@@ -44,10 +44,12 @@ multi sub MAIN (
     }
 
     # Get the puzzle from $path if it's passed.
-    if $path.IO.f {
-        @puzzle = $path.IO.lines.map(*.words.cache.Array);
-    } else {
-        @puzzle = get-puzzle($path);
+    with $path {
+        if $path.IO.f {
+            @puzzle = $path.IO.lines.map(*.words.cache.Array);
+        } else {
+            @puzzle = get-puzzle($path);
+        }
     }
 
     # set-gray-squares also removes asterisks from @puzzle.
ommitter hut <hut@lavabit.com> 2009-11-27 22:30:38 +0100 embedded wrapper.sh into ranger.py' href='/akspecs/ranger/commit/ranger.py?h=v1.4.3&id=a66c4a26f79d71210422f7d977b892d5a700dae8'>a66c4a26 ^
f027adc0 ^
5c210a96 ^

3de15ddd ^

5c210a96 ^
fb275079 ^

5c210a96 ^
3d566884 ^
a1d7ed6e ^
3d566884 ^
621a1a39 ^
9bc5d95c ^
c44b726e ^
465bff73 ^




f027adc0 ^
f8e96a97 ^

0b5c4cbe ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59