File tree Expand file tree Collapse file tree 11 files changed +31
-32
lines changed
Expand file tree Collapse file tree 11 files changed +31
-32
lines changed Original file line number Diff line number Diff line change 33use v6 ;
44
55use lib $ ? FILE . IO . parent . child (" lib" );
6- use Packaging ;
7- use Registry : kinds ;
6+ use Packager ;
7+ use Registry : Target ;
88
99sub MAIN (
10- Registry::Kind : $ target = all-registries,
10+ Registry::Target : $ target = all-registries,
1111 Bool : $ dry-run = False ,
1212) {
13- Packaging . new (
14- target => $ target ,
13+ Packager . new (
14+ target => $ target ,
1515 dry-run => $ dry-run ,
1616 ). clean;
1717}
Original file line number Diff line number Diff line change 55# I hope that reading through these scripts will show you
66# a lot of interesting concepts... and definitely fun!
77
8- unit class Packaging ;
8+ unit class Packager ;
99
1010use System;
1111use Registry;
@@ -24,8 +24,8 @@ my constant @PACKAGE-TYPES = (
2424 Registries::AUR-Bin,
2525);
2626
27- has Bool $ . dry-run is required ;
28- has Registry::Kind $ . target is required ;
27+ has Bool $ . dry-run is required ;
28+ has Registry::Target $ . target is required ;
2929
3030method clean (--> Nil ) { . clean for self ! packages }
3131method set-version (--> Nil ) { . set-version for self ! packages }
@@ -36,7 +36,7 @@ method !packages(--> Seq) {
3636 my $ sys = System. new (dry-run => $ ! dry-run );
3737 my @ packages = @ PACKAGE-TYPES . map ({ . new (sys => $ sys ) });
3838
39- return @ packages . Seq if $ ! target == Registry::Kind ::all-registries;
39+ return @ packages . Seq if $ ! target == Registry::Target ::all-registries;
4040
41- @ packages . grep (*. kind == $ ! target );
41+ @ packages . grep (*. target == $ ! target );
4242}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ my constant PKGBUILD = PKG-ROOT.child("aur").child("lefthook-bin").child("PKGBUI
1010
1111has SystemAPI $ . sys is required ;
1212
13- method kind (--> Registry::Kind : D ) { Registry::Kind ::aur-bin }
13+ method target (--> Registry::Target : D ) { Registry::Target ::aur-bin }
1414
1515method clean {}
1616
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ my constant PKGBUILD = PKG-ROOT.child("aur").child("lefthook").child("PKGBUILD")
1010
1111has SystemAPI $ . sys is required ;
1212
13- method kind (--> Registry::Kind : D ) { Registry::Kind ::aur }
13+ method target (--> Registry::Target : D ) { Registry::Target ::aur }
1414
1515method clean {}
1616
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ my constant %NPM-BUNDLED-DISTS = (
7575 arm64-openbsd => " { NPM-BUNDLED} /bin/lefthook-openbsd-arm64/lefthook" ,
7676);
7777
78- method kind (--> Registry::Kind : D ) { Registry::Kind ::npm }
78+ method target (--> Registry::Target : D ) { Registry::Target ::npm }
7979
8080method clean {
8181 $ ! sys . rm(
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ my constant @PLATFORMS = (
3030
3131has SystemAPI $ . sys is required ;
3232
33- method kind (--> Registry::Kind : D ) { Registry::Kind ::pypi }
33+ method target (--> Registry::Target : D ) { Registry::Target ::pypi }
3434
3535method clean {
3636 $ ! sys . rm(
Original file line number Diff line number Diff line change @@ -22,8 +22,7 @@ my constant %RUBYGEM-DISTS = (
2222
2323has SystemAPI $ . sys is required ;
2424
25-
26- method kind (--> Registry::Kind: D ) { Registry::Kind::rubygem }
25+ method target (--> Registry::Target: D ) { Registry::Target::rubygem }
2726
2827method clean {
2928 $ ! sys . rm(" { RUBYGEMS} /libexec/" . IO . dir . grep (*. d ));
Original file line number Diff line number Diff line change 11unit module Registry ;
22
33# Supported regitstries.
4- enum Kind is export (: kinds ) <
4+ enum Target is export (: Target ) <
55 all-registries
66
77 npm
@@ -13,7 +13,7 @@ enum Kind is export(:kinds) <
1313
1414# Abstract interface for a registry class to implement.
1515role Package {
16- method kind (--> Kind : D ) { ... }
16+ method target (--> Target : D ) { ... }
1717 method clean (--> Nil ) { ... }
1818 method set-version (--> Nil ) { ... }
1919 method prepare (--> Nil ) { ... }
Original file line number Diff line number Diff line change 33use v6 ;
44
55use lib $ ? FILE . IO . parent . child (" lib" );
6- use Packaging ;
7- use Registry : kinds ;
6+ use Packager ;
7+ use Registry : Target ;
88
99sub MAIN (
10- Registry::Kind : $ target = all-registries,
10+ Registry::Target : $ target = all-registries,
1111 Bool : $ dry-run = False ,
1212) {
13- Packaging . new (
14- target => $ target ,
13+ Packager . new (
14+ target => $ target ,
1515 dry-run => $ dry-run ,
1616 ). prepare;
1717}
Original file line number Diff line number Diff line change 33use v6 ;
44
55use lib $ ? FILE . IO . parent . child (" lib" );
6- use Packaging ;
7- use Registry : kinds ;
6+ use Packager ;
7+ use Registry : Target ;
88
99sub MAIN (
10- Registry::Kind : $ target = all-registries,
10+ Registry::Target : $ target = all-registries,
1111 Bool : $ dry-run = False ,
1212) {
1313 Packaging. new (
14- target => $ target ,
14+ target => $ target ,
1515 dry-run => $ dry-run ,
1616 ). publish;
1717}
You can’t perform that action at this time.
0 commit comments