Skip to content

Commit 314efa8

Browse files
committed
CI test prior to release
1 parent 2e0300c commit 314efa8

File tree

8 files changed

+146
-68
lines changed

8 files changed

+146
-68
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.precomp/
22
/HTML-Strip-*
3+
*.rakucov

Changes

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

33
{{$NEXT}}
4+
- Fix some doc issues
5+
- Update copyright year
46

57
0.1.2 2024-09-14T21:29:20+02:00
68
- Initial version in the zef ecosystem

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ Set this to false if you do not want this.
4444
AUTHORS
4545
=======
4646

47-
* Dagur Valberg Johannsson.
47+
* Dagur Valberg Johannsson
4848

4949
* Raku Community
5050

5151
COPYRIGHT AND LICENSE
5252
=====================
5353

54-
Copyright 2013 - 2017 =item Dagur Valberg Johannsson.
54+
Copyright 2013 - 2017 Dagur Valberg Johannsson.
5555

56-
Copyright 2024 Raku Commuity
56+
Copyright 2024 - 2025 Raku Community
5757

5858
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.
5959

dist.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = HTML::Strip
22

33
[ReadmeFromPod]
4-
filename = lib/HTML/Strip.rakumod
4+
filename = doc/HTML-Strip.rakumod
55

66
[UploadToZef]
77

doc/HTML-Strip.rakumod

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
=begin pod
2+
3+
=head1 NAME
4+
5+
HTML::Strip - Strip HTML markup from text.
6+
7+
=head1 SYNOPSIS
8+
9+
=begin code :lang<raku>
10+
11+
use HTML::Strip;
12+
my $html = q{<body>my <a href="http://">raku module</a></body>};
13+
my $clean = html_strip($html);
14+
# $clean: my raku module
15+
16+
=end code
17+
18+
=head1 DESCRIPTION
19+
20+
HTML::Strip removes HTML tags and comments from given text.
21+
22+
This module is inspired by the Perl module HTML::Strip and provides
23+
the same functionality. However, both its interface and implementation
24+
differs. This module is implemented using Raku grammars.
25+
26+
Note that this module does no XML/HTML validation. Garbage in might
27+
give you garbage out.
28+
29+
=head2 C<strip_html(Str)>
30+
31+
Removes HTML tags and comments from given text.
32+
33+
This module will also decode HTML encoded text. For example &lt; will become < .
34+
35+
=head3 C<:emit_space>
36+
37+
By default all tags are replaced by space. Set this optional parameter to
38+
False if you want them to be replaced by nothing.
39+
40+
=head3 C<:decode_entities>
41+
42+
By default HTML entities will be decoded. For example &lt; becomes <
43+
44+
Set this to false if you do not want this.
45+
46+
=head1 AUTHORS
47+
48+
=item Dagur Valberg Johannsson
49+
=item Raku Community
50+
51+
=head1 COPYRIGHT AND LICENSE
52+
53+
Copyright 2013 - 2017 Dagur Valberg Johannsson.
54+
55+
Copyright 2024 - 2025 Raku Community
56+
57+
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.
58+
59+
=end pod
60+
61+
# vim: expandtab shiftwidth=4

lib/HTML/Strip.rakumod

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class HTML::Strip::Actions {
6767
}
6868

6969
method tag_start($/) {
70-
$!inside_tag = True;
70+
$!inside_tag = True; # UNCOVERABLE
7171
$!curr_tag = "";
7272
$!is_closing_tag = False;
7373
}
@@ -143,64 +143,4 @@ my sub strip_html(
143143
$actions.out
144144
}
145145

146-
=begin pod
147-
148-
=head1 NAME
149-
150-
HTML::Strip - Strip HTML markup from text.
151-
152-
=head1 SYNOPSIS
153-
154-
=begin code :lang<raku>
155-
156-
use HTML::Strip;
157-
my $html = q{<body>my <a href="http://">raku module</a></body>};
158-
my $clean = html_strip($html);
159-
# $clean: my raku module
160-
161-
=end code
162-
163-
=head1 DESCRIPTION
164-
165-
HTML::Strip removes HTML tags and comments from given text.
166-
167-
This module is inspired by the Perl module HTML::Strip and provides
168-
the same functionality. However, both its interface and implementation
169-
differs. This module is implemented using Raku grammars.
170-
171-
Note that this module does no XML/HTML validation. Garbage in might
172-
give you garbage out.
173-
174-
=head2 C<strip_html(Str)>
175-
176-
Removes HTML tags and comments from given text.
177-
178-
This module will also decode HTML encoded text. For example &lt; will become < .
179-
180-
=head3 C<:emit_space>
181-
182-
By default all tags are replaced by space. Set this optional parameter to
183-
False if you want them to be replaced by nothing.
184-
185-
=head3 C<:decode_entities>
186-
187-
By default HTML entities will be decoded. For example &lt; becomes <
188-
189-
Set this to false if you do not want this.
190-
191-
=head1 AUTHORS
192-
193-
=item Dagur Valberg Johannsson
194-
=item Raku Community
195-
196-
=head1 COPYRIGHT AND LICENSE
197-
198-
Copyright 2013 - 2017 Dagur Valberg Johannsson.
199-
200-
Copyright 2024 Raku Community
201-
202-
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.
203-
204-
=end pod
205-
206146
# vim: expandtab shiftwidth=4

run-tests

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,68 @@
1-
unit sub MAIN(:a($author), :i($install));
1+
unit sub MAIN(
2+
:a($author),
3+
:i($install),
4+
:$rmd,
5+
:$disable-spesh,
6+
:$disable-spesh-inline,
7+
:$disable-JIT,
8+
:$enable-spesh-nodelay,
9+
:$enable-spesh-blocking,
10+
:$enable-spesh-log,
11+
);
212

313
say run(<raku --version>, :out).out.slurp.chomp;
414
say "Running on $*DISTRO.gist().\n";
515

16+
if $rmd {
17+
%*ENV<RAKUDO_MODULE_DEBUG> := 1;
18+
say "RAKUDO_MODULE_DEBUG=1";
19+
}
20+
21+
if $disable-spesh {
22+
%*ENV<MVM_SPESH_DISABLE> := 1;
23+
say "MVM_SPESH_DISABLE=1";
24+
}
25+
26+
if $disable-spesh-inline {
27+
%*ENV<MVM_SPESH_INLINE_DISABLE> := 1;
28+
say "MVM_SPESH_INLINE_DISABLE=1";
29+
}
30+
31+
if $disable-JIT {
32+
%*ENV<MVM_JIT_DISABLE> := 1;
33+
say "MVM_JIT_DISABLE=1";
34+
}
35+
36+
if $enable-spesh-nodelay {
37+
%*ENV<MVM_SPESH_NODELAY> := 1;
38+
say "MVM_SPESH_NODELAY=1";
39+
}
40+
41+
if $enable-spesh-blocking {
42+
%*ENV<MVM_SPESH_BLOCKING> := 1;
43+
say "MVM_SPESH_BLOCKING=1";
44+
}
45+
46+
my $spesh-log;
47+
if $enable-spesh-log {
48+
$spesh-log = (
49+
$enable-spesh-log ~~ Bool ?? "spesh-log" !! $enable-spesh-log
50+
).IO;
51+
%*ENV<MVM_SPESH_LOG> := $spesh-log.absolute;
52+
say "MVM_SPESH_LOG=$spesh-log.relative()";
53+
}
54+
55+
say ""
56+
if $rmd
57+
|| $disable-spesh
58+
|| $disable-spesh-inline
59+
|| $disable-JIT
60+
|| $enable-spesh-nodelay
61+
|| $enable-spesh-blocking
62+
|| $enable-spesh-log;
63+
664
say "Testing {
7-
"dist.ini".IO.lines.head.substr(7)
65+
(try "dist.ini".IO.lines.head.substr(7)) // "..."
866
}{
967
" including author tests" if $author
1068
}";
@@ -15,6 +73,7 @@ my $done = 0;
1573
sub process($proc, $filename) {
1674
if $proc {
1775
$proc.out.slurp;
76+
$spesh-log.unlink if $spesh-log;
1877
}
1978
else {
2079
@failed.push($filename);
@@ -32,6 +91,12 @@ sub process($proc, $filename) {
3291
else {
3392
say "No output received, exit-code $proc.exitcode() ($proc.signal()):\n$proc.os-error()";
3493
}
94+
95+
if $spesh-log {
96+
say "\nSpesh log requested, showing last 20000 lines:";
97+
say $spesh-log.lines(:!chomp).tail(20000).join;
98+
$spesh-log.unlink;
99+
}
35100
}
36101
}
37102

@@ -51,8 +116,12 @@ sub test-dir($dir) {
51116
}
52117

53118
test-dir("t");
119+
test-dir($_) for dir("t", :test({ !.starts-with(".") && "t/$_".IO.d})).map(*.Str).sort;
54120
test-dir("xt") if $author && "xt".IO.e;
55-
install if $install;
121+
if $install {
122+
install;
123+
++$done;
124+
}
56125

57126
if @failed {
58127
say "\nFAILED: {+@failed} of $done:";

xt/coverage.rakutest

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
use Test::Coverage;
2+
3+
must-be-complete;
4+
5+
# vim: expandtab shiftwidth=4

0 commit comments

Comments
 (0)