[ 0.10.15 ] Update filenames and extentions

1. Introduce *.raku and *.rakumod
2. Update tests and test scripts
3. Update .htaccess
4. Migrate to v6.d
parent 0047c179
Pipeline #161462585 passed with stage
in 44 minutes and 27 seconds
......@@ -48,7 +48,7 @@ mkdir -p $BLDPATH && cd "$_"
git clone https://gitlab.com/pheix/http-useragent.git && cd ./http-useragent
zef install .
export NETWORK_TESTING=1
prove -ve 'perl6 -Ilib'
prove -ve 'raku -Ilib'
unset NETWORK_TESTING
# script:
......
......@@ -2,7 +2,7 @@ unit class Pheix::Model::Version;
constant ver_maj = 0;
constant ver_min = 10;
constant ver_rel = 14;
constant ver_rel = 15;
method get_version returns Str {
( ver_maj.Str ~ q{.} ~ ver_min.Str ~ q{.} ~ ver_rel.Str );
......
......@@ -80,8 +80,8 @@ do
else
echo -e "Skip delete of ${YELLOW}${PRECOMP}${NC} folder: not existed"
fi
printf "%-72b" "Running ${YELLOW}user.p6${NC} with --mode=test argument"
check_output "`perl6 ${WWW}/user.p6 --mode=test && echo ${SUCCESSTOKEN}`" $STAGE
printf "%-72b" "Running ${YELLOW}user.raku${NC} with --mode=test argument"
check_output "`perl6 ${WWW}/user.raku --mode=test && echo ${SUCCESSTOKEN}`" $STAGE
elif [ $STAGE -eq 0 ]
then
#echo -e "Running ${YELLOW}Pheix::Addons::November::CGI${NC} tests no.1"
......@@ -210,8 +210,8 @@ do
check_output "`perl6 ./t/19-controller-basic.t && echo ${SUCCESSTOKEN}`" $STAGE
elif [ $STAGE -eq 20 ]
then
printf "%-72b" "Running ${YELLOW}user.p6${NC} tests"
check_output "`perl6 ./t/20-user-p6.t && echo ${SUCCESSTOKEN}`" $STAGE
printf "%-72b" "Running ${YELLOW}user.raku${NC} tests"
check_output "`perl6 ./t/20-user-raku.t && echo ${SUCCESSTOKEN}`" $STAGE
fi
if [ $? -eq 0 ]
......
......@@ -27,7 +27,7 @@
# IRC channel: #november-wiki over at irc.freenode.org
# Github: https://github.com/viklund/november
use v6;
use v6.d;
use lib './lib';
use Test;
use Pheix::Addons::November::CGI;
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......
use v6.d;
use Test;
use lib 'lib';
......
use v6.d;
use Test;
use lib 'lib';
......
use v6.d;
use Test;
use lib 'lib';
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......
use v6.c;
use v6.d;
use Test;
use lib 'lib';
......@@ -31,10 +31,10 @@ $httpdate ~~ s/(\d\d)\:(\d\d)\:(\d\d)/\\d\\d\\:\\d\\d\\:\\d\\d/;
$httpdate ~~ s:g/\,/\\\,/;
$httpdate ~~ s:g/\s/\\s/;
# Check user.p6 default route
# Check user.raku default route
subtest {
plan 10;
my Str $s = 'user.p6';
my Str $s = 'user.raku';
my Str $f = './t/script-' ~ $s ~ '.txt';
p6_script_redirect(
:path( './www' ),
......@@ -78,13 +78,13 @@ subtest {
if $f.IO.e {
unlink $f;
}
}, 'Check user.p6 default route';
}, 'Check user.raku default route';
# Check user.p6 index route
# Check user.raku index route
subtest {
plan 10;
%*ENV<REQUEST_URI> = '/index';
my Str $s = 'user.p6';
my Str $s = 'user.raku';
my Str $f = './t/script-' ~ $s ~ '.txt';
p6_script_redirect(
:path( './www' ),
......@@ -129,9 +129,9 @@ subtest {
unlink $f;
}
%*ENV<REQUEST_URI>:delete;
}, 'Check user.p6 index route';
}, 'Check user.raku index route';
# Check user.p6 bigbrother route
# Check user.raku bigbrother route
subtest {
plan 45;
%*ENV<REQUEST_URI> = '/bigbrother/?test';
......@@ -139,7 +139,7 @@ subtest {
'page=/index.html&' ~
'resolut=1920*1200&ref=http://pheix.org/foo-bar.html&' ~
'rnd=0.8973966537898391';
my Str $s = 'user.p6';
my Str $s = 'user.raku';
my Str $f = './t/script-' ~ $s ~ '.txt';
for (1..5) {
p6_script_redirect(
......@@ -172,15 +172,15 @@ subtest {
}
%*ENV<REQUEST_URI>:delete;
%*ENV<QUERY_STRING>:delete;
}, 'Check user.p6 bigbrother route';
}, 'Check user.raku bigbrother route';
# Check user.p6 showcaptcha route
# Check user.raku showcaptcha route
subtest {
plan 8;
%*ENV<REQUEST_URI> =
'/showcaptcha/' ~
'?%fe%6e%10%42%81%6d%77%65%f0%5d%ef%a3%18%79%99%73';
my Str $s = 'user.p6';
my Str $s = 'user.raku';
my Str $f = './t/script-' ~ $s ~ '.txt';
p6_script_redirect(
:path( './www' ),
......@@ -204,15 +204,15 @@ subtest {
unlink $f;
}
%*ENV<REQUEST_URI>:delete;
}, 'Check user.p6 showcaptcha route';
}, 'Check user.raku showcaptcha route';
# Check user.p6 sitemap route
# Check user.raku sitemap route
subtest {
plan 9;
%*ENV<REQUEST_URI> = '/sitemap.xml';
my Str $d = check_date( $pobj.indxcnt.IO.modified || now );
my Str $r = Pheix::View::Web::Headers.new.proto_sn;
my Str $s = 'user.p6';
my Str $s = 'user.raku';
my Str $f = './t/script-' ~ $s ~ '.txt';
p6_script_redirect(
:path( './www' ),
......@@ -245,14 +245,14 @@ subtest {
unlink $f;
}
%*ENV<REQUEST_URI>:delete;
}, 'Check user.p6 sitemap route';
}, 'Check user.raku sitemap route';
# Check user.p6 redirect route
# Check user.raku redirect route
subtest {
plan 3;
%*ENV<REQUEST_URI> = '/redirect/?test';
%*ENV<QUERY_STRING> = 'redirectto=https://perl6.pheix.org';
my Str $s = 'user.p6';
my Str $s = 'user.raku';
my Str $f = './t/script-' ~ $s ~ '.txt';
p6_script_redirect(
:path( './www' ),
......@@ -280,14 +280,14 @@ subtest {
}
%*ENV<REQUEST_URI>:delete;
%*ENV<QUERY_STRING>:delete;
}, 'Check user.p6 redirect route';
}, 'Check user.raku redirect route';
# Check user.p6 404 error fallback
# Check user.raku 404 error fallback
subtest {
plan 8;
%*ENV<REQUEST_URI> = '/not/existed/path';
my Int $e = 404;
my Str $s = 'user.p6';
my Str $s = 'user.raku';
my Str $f = './t/script-' ~ $s ~ '.txt';
p6_script_redirect(
:path( './www' ),
......@@ -317,15 +317,15 @@ subtest {
unlink $f;
}
%*ENV<REQUEST_URI>:delete;
}, 'Check user.p6 404 error fallback';
}, 'Check user.raku 404 error fallback';
# Check user.p6 405 error fallback
# Check user.raku 405 error fallback
subtest {
plan 8;
%*ENV<REQUEST_URI> = '/index';
%*ENV<REQUEST_METHOD> = 'POST';
my Int $e = 405;
my Str $s = 'user.p6';
my Str $s = 'user.raku';
my Str $f = './t/script-' ~ $s ~ '.txt';
p6_script_redirect(
:path( './www' ),
......@@ -356,14 +356,14 @@ subtest {
}
%*ENV<REQUEST_URI>:delete;
%*ENV<REQUEST_METHOD>:delete;
}, 'Check user.p6 405 error fallback';
}, 'Check user.raku 405 error fallback';
# Check user.p6 400 error with empty method name
# Check user.raku 400 error with empty method name
subtest {
plan 8;
%*ENV<REQUEST_URI> = '/fakepath/noaction';
my Int $e = 400;
my Str $s = 'user.p6';
my Str $s = 'user.raku';
my Str $f = './t/script-' ~ $s ~ '.txt';
p6_script_redirect(
:path( './www' ),
......@@ -393,14 +393,14 @@ subtest {
unlink $f;
}
%*ENV<REQUEST_URI>:delete;
}, 'Check user.p6 400 error with empty method name';
}, 'Check user.raku 400 error with empty method name';
# Check user.p6 400 error with undefined method
# Check user.raku 400 error with undefined method
subtest {
plan 8;
%*ENV<REQUEST_URI> = '/fakepath/undefinedaction';
my Int $e = 400;
my Str $s = 'user.p6';
my Str $s = 'user.raku';
my Str $f = './t/script-' ~ $s ~ '.txt';
p6_script_redirect(
:path( './www' ),
......@@ -430,9 +430,9 @@ subtest {
unlink $f;
}
%*ENV<REQUEST_URI>:delete;
}, 'Check user.p6 400 error with undefined method';
}, 'Check user.raku 400 error with undefined method';
# Check user.p6 presentation route
# Check user.raku presentation route
subtest {
plan 8;
my $_db = 'presentation';
......@@ -441,7 +441,7 @@ subtest {
table => $_db,
fields => <id data compression>
);
my Str $s = 'user.p6';
my Str $s = 'user.raku';
my Str $f = './t/script-' ~ $s ~ '.txt';
p6_script_redirect(
:path( './www' ),
......@@ -488,9 +488,9 @@ subtest {
unlink $f;
}
%*ENV<REQUEST_URI>:delete;
}, 'Check user.p6 presentation route';
}, 'Check user.raku presentation route';
# Check user.p6 TPC20CiC presentation route
# Check user.raku TPC20CiC presentation route
subtest {
plan 8;
my $_db = 'tpc20cic';
......@@ -499,7 +499,7 @@ subtest {
table => $_db ~ '_presentation',
fields => <id data compression>
);
my Str $s = 'user.p6';
my Str $s = 'user.raku';
my Str $f = './t/script-' ~ $s ~ '.txt';
p6_script_redirect(
:path( './www' ),
......@@ -546,7 +546,7 @@ subtest {
unlink $f;
}
%*ENV<REQUEST_URI>:delete;
}, 'Check user.p6 TPC20CiC presentation route';
}, 'Check user.raku TPC20CiC presentation route';
sub header_test(
Str :$output,
......
AddHandler cgi-script .p6
DirectoryIndex user.p6
AddHandler cgi-script .raku
DirectoryIndex user.raku
<FilesMatch "\.(htaccess|htpasswd|sh|bash|t)$">
order allow,deny
......@@ -7,16 +7,16 @@ DirectoryIndex user.p6
</FilesMatch>
RewriteEngine on
# RewriteRule ^$ user.p6?action=index
# RewriteRule ^index.htm$ user.p6?action=index
# RewriteRule ^([a-z/-]+).html$ user.p6?action=$1&amp;%{QUERY_STRING}
# RewriteRule ^([a-z/-]+)_([a-z0-9]+).html$ user.p6?action=$1&id=$2&amp;%{QUERY_STRING}
# RewriteRule ^([a-z/-]+)_([a-z0-9]+)_([a-z0-9]+).html$ user.p6?action=$1&id1=$2&id2=$3&amp;%{QUERY_STRING}
# RewriteRule ^rss.xml$ user.p6?action=getnewsrss
# RewriteRule ^sitemap.xml$ user.p6?action=pheix-sitemap-xml
# ErrorDocument 404 /user.p6?action=404error
# RewriteRule ^$ user.raku?action=index
# RewriteRule ^index.htm$ user.raku?action=index
# RewriteRule ^([a-z/-]+).html$ user.raku?action=$1
# RewriteRule ^([a-z/-]+)_([a-z0-9]+).html$ user.raku?action=$1&id=$2
# RewriteRule ^([a-z/-]+)_([a-z0-9]+)_([a-z0-9]+).html$ user.raku?action=$1&id1=$2&id2=$3
# RewriteRule ^rss.xml$ user.raku?action=getnewsrss
# RewriteRule ^sitemap.xml$ user.raku?action=pheix-sitemap-xml
# ErrorDocument 404 /user.raku?action=404error
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ user.p6 [L]
RewriteRule ^(.*)$ user.raku [L]
#!/usr/bin/env perl6
#!/usr/bin/env raku
use v6.c;
use v6.d;
BEGIN {
use lib './lib';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment