File Coverage

blib/lib/WWW/Mixi/OO/ListMessage.pm
Criterion Covered Total %
statement 12 40 30.0
branch 0 8 0.0
condition n/a
subroutine 4 8 50.0
pod 2 2 100.0
total 18 58 31.0


\s*\s*
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: ListMessage.pm 100 2005-02-04 19:19:55Z topia $
6             # $URL: file:///usr/minetools/svnroot/mixi/trunk/WWW-Mixi-OO/lib/WWW/Mixi/OO/ListMessage.pm $
7             package WWW::Mixi::OO::ListMessage;
8 1     1   1258 use strict;
  1         2  
  1         35  
9 1     1   6 use warnings;
  1         2  
  1         26  
10 1     1   6 use File::Basename;
  1         2  
  1         97  
11 1     1   6 use base qw(WWW::Mixi::OO::TableHistoryListPage);
  1         3  
  1         714  
12              
13             our %envelopes = (
14             'img/mail1.gif' => 'new',
15             'img/mail2.gif' => 'opened',
16             'img/mail5.gif' => 'replied',
17             );
18              
19             sub uri {
20 0     0 1   my $this = shift;
21 0           my $options = $this->_init_uri(@_);
22              
23 0           $this->copy_hash_val($options, $options->{_params}, 'box');
24 0           $this->SUPER::uri($options);
25             }
26              
27             sub parse_uri {
28 0     0 1   my ($this, $data, %options) = @_;
29              
30 0           $this->copy_hash_val($data->{params}, \%options, 'box');
31 0           $this->SUPER::parse_uri($data, %options);
32             }
33              
34             sub _parse_table {
35 0     0     my $this = shift;
36 0 0         return $this->SUPER::_parse_table(@_) if @_ == 1; # overridable
37              
38 0           my $attr_regex = $this->regex_parts->{html_attr};
39 0           my $attrval_regex = $this->regex_parts->{html_attrval};
40 0           my $maybe_attrs_regex = $this->regex_parts->{html_maybe_attrs};
41 0           $this->SUPER::_parse_table(
42             qr|\s*
43            
44             ((?>.*?)\s*
45            
\s*.+)\s*
46            
(?>.*?)\s* 47             |oisx); 48             } 49               50             sub _parse_body { 51 0     0     my $this = shift; 52 0           my $part = $this->parse_table_item('body'); 53 0 0         return () unless defined $part; 54 0           my $maybe_attrs_regex = $this->regex_parts->{html_maybe_attrs}; 55 0           my $attrval_regex = $this->regex_parts->{html_attrval}; 56 0           my $regex = qr| 57             \s* 58             \s* 59             (?>(.*?))\s* 60             (?>(.*?))\s* 61             (?>(.*?))|oisx; 62 0           my ($img, $name, $anchor, $subject, $date); 63             return [map { 64 0 0         if (m|   0 0           65             # header 66 0           (); 67             } elsif (($img, $name, $anchor, $subject, $date) = /$regex/) { 68 0           $anchor = $this->html_anchor_to_uri($anchor); 69 0           $img = $this->html_attr_to_uri('src', $img); 70 0           my $data = { 71             date => $this->convert_time($date), 72             time => $this->convert_time($date), 73             name => $this->rewrite($name), 74             subject => $this->rewrite($subject), 75             link => $anchor, 76             image => $img, 77             status => $envelopes{$this->relative_uri($img)}, 78             $this->analyze_uri($anchor), 79             }; 80 0           $data; 81             } else { 82 0           (); 83             } 84             } $part =~ m|(?>(.*?))\s* 85             \s*\s* 86             \s*|oisxg]; 87             } 88               89             1;