File Coverage

blib/lib/Acme/Web20/Validator/Rule/HasTrackbackURI.pm
Criterion Covered Total %
statement 11 17 64.7
branch 0 6 0.0
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 15 28 53.5


line stmt bran cond sub pod time code
1             #$Id: HasTrackbackURI.pm,v 1.1 2005/11/14 03:39:09 naoya Exp $
2             package Acme::Web20::Validator::Rule::HasTrackbackURI;
3 2     2   1375 use strict;
  2         5  
  2         63  
4 2     2   10 use warnings;
  2         4  
  2         57  
5 2     2   9 use base qw (Acme::Web20::Validator::Rule);
  2         4  
  2         508  
6              
7             __PACKAGE__->name('Has auto-discoverable Trackback URI?');
8              
9             sub validate {
10 1     1 0 3 my ($self, $res) = @_;
11 1         7 while ($res->content =~ m!()!sg) {
12 0           my $rdf = $1;
13 0           my $ping_url;
14 0 0         if ($rdf =~ m!trackback:ping="(.+?)"!) {
    0          
15 0           $ping_url = $1;
16             } elsif ($rdf =~ m!about="(.+?)"!) {
17 0           $ping_url = $1;
18             }
19 0 0         return $self->is_ok(1) if $ping_url;
20             }
21             }
22              
23             1;