App-Wallflower
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Wallflower/Util.pm view on Meta::CPAN
# CSS
my $css_regexp = qr{
(?:
\@import\s+(?:"([^"]+)"|'([^']+)')
| url\((?:"([^"]+)"|'([^']+)'|([^)]+))\)
)
}x;
sub _links_from_css {
my ( $file, $url ) = @_;
my $content = do { local ( *ARGV, $/ ); @ARGV = ("$file"); <> };
return map URI->new_abs( $_, $url ), grep defined,
$content =~ /$css_regexp/gc;
}
1;
__END__
=pod
my $result = $wf->get($url);
is_deeply(
$result,
[ $status, $headers, $file && Path::Tiny->new( $dir, $file )
],
"app ($desc) for $url"
);
if ( $status == 200 || $status == 304 ) {
my $file_content
= do { local $/; local @ARGV = ( $result->[2] ); <> };
is( $file_content, $content, "content ($desc) for $url" );
}
else {
is( $result->[2], '', "no file ($desc) for $url" );
}
}
}
t/40-mount.t view on Meta::CPAN
my $result = $wf->get($url);
is_deeply(
$result,
[ $status, $headers, $file && Path::Tiny->new( $dir, $file ) ],
"app ($desc) for $url"
);
if ( $status == 200 ) {
my $file_content
= do { local $/; local @ARGV = ( $result->[2] ); <> };
is( $file_content, $content, "content ($desc) for $url" );
}
else {
is( $result->[2], '', "no file ($desc) for $url" );
}
}
}
t/50-smoke.t view on Meta::CPAN
my $result = $wf->get($url);
is_deeply(
$result,
[ $status, $headers, $file && Path::Tiny->new( $dir, $file ) ],
"app ($desc) for $url"
);
if ( $status == 200 ) {
my $file_content
= do { local $/; local @ARGV = ( $result->[2] ); <> };
is( $file_content, $content, "content ($desc) for $url [$status]" );
}
else {
is( $result->[2], '', "no file ($desc) for $url [$status]" );
}
}
}
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.479 second using v1.00-cache-2.02-grep-82fe00e-cpan-da92000dfeb )