ClientVersion.pm

filter: Statementstmt 88.2% 15 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 91.3% 21 / 23 CC 1 SCAR 0.5
CC
1
Cov
88%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Superdoc.pm ↑ Summary
1 # E2::ClientVersion
2 # Jose M. Weeks <jose@joseweeks.com>
3 # 05 June 2003
4 #
5 # See bottom for pod documentation.
6  
7 package E2::ClientVersion;
8  
9 1 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 ▶use E2::Ticker;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 0 ▶use XML::Twig;
Subroutine BEGIN: called CC=1 SCAR=2.6
16  
17 our $VERSION = "0.31";
18 our @ISA = qw(E2::Ticker);
19 our $DEBUG; *DEBUG = *E2::Interface::DEBUG;
20  
21 sub new;
22  
23 sub update;
24  
25 sub clients;
26  
27 sub new {
28 my $arg = shift;
29 my $class = ref( $arg ) || $arg;
30 my $self = $class->SUPER::new();
31  
32 $self->{clients} = {};
33  
34 return bless ($self, $class);
35 }
36  
37  
38 sub clients {
39 my $self = shift or croak "Usage: clients E2CLIENTVERSION";
40 return $self->{clients};
41 }
42  
43 sub update {
44 my $self = shift or croak "Usage: update E2CLIENTVERSION";
45  
46 warn "E2::ClientVersion::Update\n" if $DEBUG > 1;
47  
48 my $handlers = {
49 'client' => sub {
50 (my $a, my $b) = @_;
51 my %client;
52  
53 $client{name} = $b->{att}->{client_class};
54 $client{id} = $b->{att}->{client_id};
55 $client{version} =
56 $b->first_child('version')->text;
57 $client{homepage} =
58 $b->first_child('homepage')->text;
59 $client{download} =
60 $b->first_child('download')->text;
61  
62 my $c = $b->first_child('maintainer');
63 $client{maintainer} = $c->text;
64 $client{maintainer_id} = $c->{att}->{node_id};
65  
66 $self->{clients}->{$client{name}} = \%client;
67 }
68 };
69  
70 $self->{clients} = {};
71  
72 return $self->parse(
73 'clientversions',
74 $handlers,
75 [ 1 ]
76 );
77 }
78  
79 1;
80 __END__
« Superdoc.pm ↑ Summary