Skip to content

Commit 0d6a3b3

Browse files
committed
CI test prior to release
1 parent 3db2820 commit 0d6a3b3

File tree

8 files changed

+225
-15
lines changed

8 files changed

+225
-15
lines changed

.META/SOURCE.cdx.json

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
{
2+
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
3+
"bomFormat": "CycloneDX",
4+
"specVersion": "1.6",
5+
"version": 1,
6+
"metadata": {
7+
"timestamp": "2025-08-03T12:14:59+00:00",
8+
"lifecycles": [
9+
{
10+
"phase": "pre-build"
11+
}
12+
],
13+
"authors": [
14+
{
15+
"bom-ref": "ElizabethMattijsen",
16+
"name": "Elizabeth Mattijsen"
17+
}
18+
],
19+
"component": {
20+
"type": "library",
21+
"mime-type": "text/plain",
22+
"bom-ref": "pkg:raku/zef:lizmat/String::[email protected]",
23+
"authors": [
24+
{
25+
"bom-ref": "ElizabethMattijsen",
26+
"name": "Elizabeth Mattijsen"
27+
}
28+
],
29+
"publisher": "zef",
30+
"group": "zef:lizmat",
31+
"name": "String::Utils",
32+
"version": "0.0.35",
33+
"description": "Provide some optimized string functions",
34+
"scope": "required",
35+
"licenses": [
36+
{
37+
"license": {
38+
"id": "Artistic-2.0",
39+
"acknowledgement": "declared",
40+
"url": "https://spdx.org/licenses/Artistic-2.0.json"
41+
}
42+
}
43+
],
44+
"purl": "pkg:raku/zef:lizmat/String::[email protected]",
45+
"externalReferences": [
46+
{
47+
"url": "https://raku.land/zef:lizmat/String::Utils?v=0.0.35",
48+
"type": "documentation"
49+
},
50+
{
51+
"url": "https://github.com/lizmat/String-Utils",
52+
"type": "distribution"
53+
},
54+
{
55+
"url": "https://github.com/lizmat/String-Utils/issues",
56+
"type": "issue-tracker"
57+
},
58+
{
59+
"url": "https://github.com/lizmat/String-Utils/archive/refs/tags/0.0.35.zip",
60+
"type": "source-distribution"
61+
},
62+
{
63+
"url": "https://spdx.org/licenses/Artistic-2.0.json",
64+
"type": "license"
65+
}
66+
],
67+
"tags": [
68+
"STRING",
69+
"UTIL",
70+
"CHOMP",
71+
"SHA1",
72+
"STEM",
73+
"NGRAM",
74+
"NAUGHTY",
75+
"WORD",
76+
"MARKS"
77+
]
78+
},
79+
"licenses": [
80+
{
81+
"license": {
82+
"id": "Artistic-2.0",
83+
"acknowledgement": "declared",
84+
"url": "https://spdx.org/licenses/Artistic-2.0.json"
85+
}
86+
}
87+
],
88+
"tools": {
89+
"components": [
90+
{
91+
"type": "library",
92+
"mime-type": "text/plain",
93+
"bom-ref": "pkg:raku/zef:lizmat/SBOM::[email protected]",
94+
"authors": [
95+
{
96+
"bom-ref": "ElizabethMattijsen",
97+
"name": "Elizabeth Mattijsen"
98+
}
99+
],
100+
"publisher": "zef",
101+
"group": "zef:lizmat",
102+
"name": "SBOM::Raku",
103+
"version": "0.0.6",
104+
"description": "Raku specific SBOM functionality",
105+
"scope": "required",
106+
"licenses": [
107+
{
108+
"license": {
109+
"id": "Artistic-2.0",
110+
"acknowledgement": "declared",
111+
"url": "https://spdx.org/licenses/Artistic-2.0.json"
112+
}
113+
}
114+
],
115+
"purl": "pkg:raku/zef:lizmat/SBOM::[email protected]",
116+
"externalReferences": [
117+
{
118+
"url": "https://raku.land/zef:lizmat/SBOM::Raku?v=0.0.6",
119+
"type": "documentation"
120+
},
121+
{
122+
"url": "mailto:[email protected]",
123+
"type": "support"
124+
},
125+
{
126+
"url": "https://github.com/lizmat/SBOM-Raku/issues",
127+
"type": "issue-tracker"
128+
},
129+
{
130+
"url": "https://github.com/lizmat/SBOM-Raku",
131+
"type": "distribution"
132+
},
133+
{
134+
"url": "https://github.com/lizmat/SBOM-Raku/archive/refs/tags/0.0.6.zip",
135+
"type": "source-distribution"
136+
},
137+
{
138+
"url": "https://spdx.org/licenses/Artistic-2.0.json",
139+
"type": "license"
140+
}
141+
],
142+
"tags": [
143+
"SBOM",
144+
"RAKU",
145+
"META"
146+
]
147+
}
148+
]
149+
}
150+
},
151+
"externalReferences": [
152+
{
153+
"url": "https://raku.land/zef:lizmat/String::Utils?v=0.0.35",
154+
"type": "documentation"
155+
},
156+
{
157+
"url": "https://github.com/lizmat/String-Utils",
158+
"type": "distribution"
159+
},
160+
{
161+
"url": "https://github.com/lizmat/String-Utils/issues",
162+
"type": "issue-tracker"
163+
},
164+
{
165+
"url": "https://github.com/lizmat/String-Utils/archive/refs/tags/0.0.35.zip",
166+
"type": "source-distribution"
167+
},
168+
{
169+
"url": "https://spdx.org/licenses/Artistic-2.0.json",
170+
"type": "license"
171+
}
172+
]
173+
}

Changes

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

33
{{$NEXT}}
4+
- Added support for "describe-Version"
5+
- Reached 100% coverage testing
46

57
0.0.35 2025-07-25T11:56:18+02:00
68
- Added support for "text-from-url"

META6.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@
1010
"description": "Provide some optimized string functions",
1111
"license": "Artistic-2.0",
1212
"name": "String::Utils",
13-
"perl": "6.d",
1413
"provides": {
1514
"String::Utils": "lib/String/Utils.rakumod"
1615
},
16+
"raku": "6.d",
1717
"resources": [
1818
],
1919
"source-url": "https://github.com/lizmat/String-Utils.git",
20+
"support": {
21+
"bugtracker": "https://github.com/lizmat/String-Utils/issues",
22+
"source": "https://github.com/lizmat/String-Utils.git"
23+
},
2024
"tags": [
2125
"STRING",
2226
"UTIL",
@@ -30,5 +34,5 @@
3034
],
3135
"test-depends": [
3236
],
33-
"version": "0.0.35"
37+
"version": "0.0.36"
3438
}

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,16 @@ say consists-of("", "abc"); # True
228228

229229
Returns a `Bool` indicating whether the string given as the first positional argument only consists of characters given as the second positional argument, or is empty.
230230

231+
describe-Version
232+
----------------
233+
234+
```raku
235+
say $*VM.version; # v2025.06.5.gb.1.c.74.b.8.d.8
236+
say describe-Version($*VM.version); # 2025.06-5-gb1c74b8d8
237+
```
238+
239+
The `describe-Version` subroutine takes a `Version` object and returns a string in the "git describe" format.
240+
231241
expand-tab
232242
----------
233243

doc/String-Utils.rakudoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,16 @@ Returns a C<Bool> indicating whether the string given as the first
237237
positional argument only consists of characters given as the second
238238
positional argument, or is empty.
239239

240+
=head2 describe-Version
241+
242+
=begin code :lang<raku>
243+
say $*VM.version; # v2025.06.5.gb.1.c.74.b.8.d.8
244+
say describe-Version($*VM.version); # 2025.06-5-gb1c74b8d8
245+
=end code
246+
247+
The C<describe-Version> subroutine takes a C<Version> object and
248+
returns a string in the "git describe" format.
249+
240250
=head2 expand-tab
241251

242252
=begin code :lang<raku>

lib/String/Utils.rakumod

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,17 @@ my sub consists-of(str $string, str $chars) {
158158
nqp::hllbool(nqp::iseq_i($i,$elems))
159159
}
160160

161+
#- describe-Version ------------------------------------------------------------
162+
my sub describe-Version(Str() $version) {
163+
if after($version,"g") -> $sha {
164+
my @major = before($version,"g").split(".", :skip-empty);
165+
"@major.head(*-1).join(".")-@major.tail()-g$sha.subst('.',:global)"
166+
}
167+
else {
168+
$version
169+
}
170+
}
171+
161172
#- expand-tab ------------------------------------------------------------------
162173
my sub expand-tab(str $spec, int $size) {
163174
my str @parts = nqp::split("\t",$spec);
@@ -666,6 +677,6 @@ my sub EXPORT(*@names) {
666677

667678
#- hack ------------------------------------------------------------------------
668679
# To allow version / auth / api fetching
669-
module String::Utils:ver<0.0.35>:auth<zef:lizmat> { }
680+
module String::Utils:ver<0.0.36>:auth<zef:lizmat> { }
670681

671682
# vim: expandtab shiftwidth=4

t/01-basic.rakutest

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use Test;
22
use String::Utils;
33

4-
plan 117;
4+
plan 120;
55

66
is after("foobar","foo"), "bar", 'after(foo) ok?';
77
is "foobar".&after("foo"), "bar", '.&after(foo) ok?';
@@ -57,7 +57,10 @@ is-deeply stem("foo.tar.gz"), 'foo', 'stem without number of extensions';
5757
is-deeply stem("foo.tar.gz", 1), 'foo.tar', 'stem, 1 extension removed';
5858
is-deeply stem("foo.tar.gz", *), 'foo', 'stem, all extensions removed';
5959

60-
is-deeply ngram("foobar", 3), <foo oob oba bar>,
60+
is ngram("foobar",3).iterator.count-only, 4, 'does count-only produce ok';
61+
ngram("foobar",3); # sink-all test
62+
my @ngrams is List = ngram("foobar",3);
63+
is-deeply @ngrams, <foo oob oba bar>,
6164
'did trigrams work';
6265
is-deeply ngram("foobar", 4, :partial), <foob ooba obar bar ar r>,
6366
'did quadgrams work with partial';
@@ -149,6 +152,11 @@ ok String::Utils.^ver, 'can we get a version from the module';
149152
is String::Utils.^auth, 'zef:lizmat', 'can we get an auth from the module';
150153
nok String::Utils.^api, 'can we get an api from the module';
151154

152-
is paragraphs($*PROGRAM.lines).elems, 34, 'reading from file lazily';
155+
is describe-Version(v2025.06.5.gb.1.c.74.b.8.d.8), "2025.06-5-gb1c74b8d8",
156+
'was a version with additional commits correctly described';
157+
is describe-Version(v2025.06), "2025.06",
158+
'was a version without additional commits correctly described';
159+
160+
is paragraphs($*PROGRAM.lines).elems, 35, 'reading from file lazily';
153161

154162
# vim: expandtab shiftwidth=4

xt/coverage.rakutest

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
use Test::Coverage;
22

3-
plan 2;
4-
5-
coverage-at-least 96;
6-
7-
uncovered-at-most 4;
8-
9-
report;
10-
11-
source-with-coverage;
3+
must-be-complete;
124

135
# vim: expandtab shiftwidth=4

0 commit comments

Comments
 (0)