Skip to content

Commit b0d04a0

Browse files
committed
CI test before release
1 parent 9ebcdc7 commit b0d04a0

5 files changed

Lines changed: 17 additions & 10 deletions

File tree

‎Changes‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Revision history for PURL
22

33
{{$NEXT}}
4+
- Disallowed simultaneous @version and ?vers=vers:...
5+
- Bumped dependency on VERS to get correct canonicalization
46
- Changed qualifier key "sw_vers" to "vers", as that
57
appears to be canon now
68

‎META6.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"Identity::Utils:ver<0.0.25+>:auth<zef:lizmat>",
1212
"JSON::Fast:ver<0.19+>:auth<cpan:TIMOTIMO>",
1313
"URI::Encode:ver<1.0+>:auth<zef:raku-community-modules>",
14-
"VERS:ver<0.0.1+>:auth<zef:lizmat>"
14+
"VERS:ver<0.0.2+>:auth<zef:lizmat>"
1515
]
1616
}
1717
},
@@ -41,5 +41,5 @@
4141
],
4242
"test-depends": [
4343
],
44-
"version": "0.0.12"
44+
"version": "0.0.13"
4545
}

‎lib/PURL.rakumod‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use Identity::Utils:ver<0.0.25+>:auth<zef:lizmat> <
33
>;
44
use JSON::Fast:ver<0.19+>:auth<cpan:TIMOTIMO>;
55
use URI::Encode:ver<1.0+>:auth<zef:raku-community-modules>;
6-
use VERS:ver<0.0.1+>:auth<zef:lizmat>;
6+
use VERS:ver<0.0.2+>:auth<zef:lizmat>;
77

8-
use PURL::Type:ver<0.0.12>:auth<zef:lizmat>;
8+
use PURL::Type:ver<0.0.13>:auth<zef:lizmat>;
99

1010
#- helper subroutines ----------------------------------------------------------
1111

@@ -18,7 +18,7 @@ my sub is-identifier($_) {
1818
my sub trim-slashes(Str:D $_) { .subst(/^ '/'+ /).subst(/ '/'+ $/) }
1919

2020
#- PURL ------------------------------------------------------------------------
21-
class PURL:ver<0.0.12>:auth<zef:lizmat> {
21+
class PURL:ver<0.0.13>:auth<zef:lizmat> {
2222
has Str $.scheme = 'pkg';
2323
has Str $.type is required;
2424
has Str $.name;
@@ -103,6 +103,9 @@ class PURL:ver<0.0.12>:auth<zef:lizmat> {
103103
with $remainder.rindex("@") -> $index {
104104
%args<version> = uri_decode $remainder.substr($index + 1);
105105

106+
die "Cannot have a version (%args<version>) and a VERS ($_)"
107+
with %args<qualifiers> andthen .<vers>;
108+
106109
$remainder .= substr(0, $index);
107110
}
108111

‎lib/PURL/Type.rakumod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ my %examples := BEGIN {
3636
}
3737

3838
#- PURL::Type ------------------------------------------------------------------
39-
class PURL::Type:ver<0.0.12>:auth<zef:lizmat> {
39+
class PURL::Type:ver<0.0.13>:auth<zef:lizmat> {
4040
method default-repository() { "" }
4141

4242
method check-identity($name, $, $ --> Nil) {

‎t/01-basic.rakutest‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ my @identities = <
1010
Cro::RPC::JSON:ver<0.1.6>:auth<zef:vrurg>:api<2>
1111
>;
1212

13-
plan 25 + @identities;
13+
plan 26 + @identities;
1414

1515
my $purl = PURL.new("pkg:maven/org.apache.commons/io@1.3.4");
1616
isa-ok $purl, PURL;
@@ -68,12 +68,14 @@ is PURL.from-identity("PURL:api<2>"), 'pkg:raku/PURL@*:2',
6868

6969
dies-ok { PURL.from-identity("PURL", :must-be-pinned) },
7070
'throws when an unpinned identity is given, and it must be pinned';
71+
dies-ok { PURL.new("pkg:raku/zef:foo/Bar@1?vers=vers:raku/1") },
72+
'throws when a version and a VERS are specified';
7173

72-
$purl = PURL.new("pkg:raku/zef:lizmat/PURL?vers=vers:raku/<2.0|>=1.0");
74+
$purl = PURL.new("pkg:raku/zef:lizmat/PURL?vers=vers:raku/<2.0 | >=1.0");
7375
is $purl,
74-
"pkg:raku/zef:lizmat/PURL?vers=vers:raku/%3E=1.0%20%7C%20%3C2.0",
76+
"pkg:raku/zef:lizmat/PURL?vers=vers:raku/%3E=1.0%7C%3C2.0",
7577
"did the software version get canonicalized correctly";
76-
is $purl.VERS, "vers:raku/>=1.0 | <2.0", 'is the VERS correct';
78+
is $purl.VERS, "vers:raku/>=1.0|<2.0", 'is the VERS correct';
7779

7880
is-deeply PURL("pkg:raku/zef:lizmat/PURL?vers=foo"), False,
7981
"does an illegal vers value invalidate a PURL";

0 commit comments

Comments
 (0)