File Coverage

blib/lib/WWW/Mixi/OO/ShowLog.pm
Criterion Covered Total %
statement 9 39 23.0
branch 0 8 0.0
condition n/a
subroutine 3 6 50.0
pod 0 1 0.0
total 12 54 22.2


line stmt bran cond sub pod time code
1             # -*- cperl -*-
2             # copyright (C) 2005 Topia . all rights reserved.
3             # This is free software; you can redistribute it and/or modify it
4             # under the same terms as Perl itself.
5             # $Id: ShowLog.pm 94 2005-02-04 12:39:28Z topia $
6             # $URL: file:///usr/minetools/svnroot/mixi/trunk/WWW-Mixi-OO/lib/WWW/Mixi/OO/ShowLog.pm $
7             package WWW::Mixi::OO::ShowLog;
8 1     1   915 use strict;
  1         2  
  1         34  
9 1     1   7 use warnings;
  1         2  
  1         29  
10 1     1   5 use base qw(WWW::Mixi::OO::TableHistoryListPage);
  1         3  
  1         694  
11              
12             sub _split_tables {
13 0     0     my ($this, $part) = @_;
14              
15 0           my $maybe_attrs_regex = $this->regex_parts->{html_maybe_attrs};
16 0           (my $head, $part) = $part =~ m|^((?>.*?
))\s*(.*)\Z|ois; 17 0           my @tables = $part =~ m| 18             (?>.*?((?>.*?))) 19             (?>.*?)\s*|oixsg; 20 0           unshift @tables, $head; 21 0           $part = pop @tables; 22 0           $part =~ m| 23             (?>.*?){3} 24             \s*\s*(?>(.*?)) 25             \s*\s*(?>(.*?))|oixs; 26 0           push @tables, $1, $2; 27 0           $this->cache->{tables} = \@tables; 28 0           $this->cache->{indecies}->{title} = 0; 29 0           $this->cache->{indecies}->{info} = 1; 30 0           $this->cache->{indecies}->{count} = 2; 31 0           $this->cache->{indecies}->{body} = 3; 32             } 33               34             sub parse_count { 35 0     0 0   my $this = shift; 36 0           my $part = $this->parse_table_item('count'); 37 0 0         return () unless defined $part; 38 0 0         return () unless $part =~ m|(\d+)|io; 39 0           return $1; 40             } 41               42             sub _parse_body { 43 0     0     my $this = shift; 44 0           my $part = $this->parse_table_item('body'); 45 0 0         return () unless defined $part; 46 0           my $maybe_attrs_regex = $this->regex_parts->{html_maybe_attrs}; 47 0           my $regex = qr|^(.*)\s+(.*?)
|oisx; 48 0           my ($date, $anchor, $name); 49             return [map { 50 0 0         if (($date, $anchor, $name) = /$regex/) {   0             51 0           $anchor = $this->html_anchor_to_uri($anchor); 52 0           my $data = { 53             date => $this->convert_time($date), 54             time => $this->convert_time($date), 55             name => $this->rewrite($name), 56             link => $anchor, 57             $this->analyze_uri($anchor), 58             }; 59 0           $data; 60             } else { 61 0           (); 62             } 63             } $part =~ m|\s*(.*?
)|oisg]; 64             } 65               66             1;