We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b46eaf commit 8000e26Copy full SHA for 8000e26
util/new-type.p6
@@ -0,0 +1,40 @@
1
+use v6;
2
+
3
+sub MAIN($typename, :$kind='class') {
4
+ my @path-chunks = $typename.split('::');
5
+ my $filename = @path-chunks.pop ~ '.pod';
6
+ my $path = 'lib/Type';
7
+ for @path-chunks -> $c {
8
+ $path ~= "/$c";
9
+ unless $path.IO.d {
10
+ mkdir $path.IO.mkdir;
11
+ }
12
13
14
+ $path ~= "/$filename";
15
16
+ spurt $path.IO, Q:s:to/TEMPLATE/;
17
+ =begin pod
18
19
+ =TITLE $kind $typename
20
21
+ =SUBTITLE ...
22
23
+ $kind $typename is SuperClass { ... }
24
25
+ Synopsis goes here
26
27
+ =head1 Methods
28
29
+ =head2 method flurb
30
31
+ method flurb($typename:D: *@args --> Str)
32
33
+ method description here
34
35
+ =end pod
36
+ TEMPLATE
37
38
+ say "'$path' written";
39
+ say "(remeber to 'git add $path')";
40
+}
0 commit comments