lib/Geo/Ov2/Grabber.pm

filter: Statementstmt 40.4% 19 / 47 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 55.5% 5 / 9 Podpod 25.0% 1 / 4 totaltotal 34.2% 25 / 73 CC 8 SCAR 29.2
CC
8
Cov
33%
new
42.0
grab_all
12.0
grab
2.0
CRAP 18.6
↑ Summary lib/Geo/Ov2/grab.poi.cz.pl »
1 package Geo::Ov2::Grabber;
2  
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Module::Util qw( :all );
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Module::Runtime qw(is_valid_module_name require_module use_module use_package_optimistically is_valid_module_spec compose_module_name);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9  
10 =head1 NAME
11  
12 Geo::Ov2::Grabber - The great new Geo::Ov2::Grabber!
13  
14 =head1 VERSION
15  
16 Version 0.01_02
17  
18 =cut
19  
20 2 our $VERSION = '0.01_02';
21  
22 2 our %grabber_modules;
23 2 our $OVG = undef;
24  
25 =head1 SYNOPSIS
26  
27 Quick summary of what the module does.
28  
29 Perhaps a little code snippet.
30  
31 use Geo::Ov2::Grabber;
32  
33 my $foo = Geo::Ov2::Grabber->new();
34 ...
35  
36 =head1 EXPORT
37  
38 A list of functions that can be exported. You can delete this section
39 if you don't export anything, such as for a purely object-oriented module.
40  
41 =head1 FUNCTIONS
42  
43 =head2 new
44  
45 =cut
46  
47 0 ▶sub new {
Subroutine new: not called CC=6 SCAR=37.4
Pod documented
48 0 ▶ return $OVG if $OVG;
Branch: 1 branch
BranchTrueFalseTotal
if $Geo::Ov2::Grabber::OVG 0 0 0
49 0 my $class = shift;
50 0 my $params = shift;
51 0 my $self = {};
52 0 bless $self, $class;
53 0 my $packagebase = __PACKAGE__;
54 0 my $packagegrabber = "${packagebase}";
55 0 my @denied_grabbers = ( );
56 0 ▶ push @denied_grabbers, @{$$params{denied_grabbers}} if @{$$params{denied_grabbers}};
Branch: 1 branch
BranchTrueFalseTotal
if @{$params->{"denied_grabbers"};} 0 0 0
57 0 foreach my $module ( find_in_namespace( $packagegrabber ) ) {
58 0 ▶ next if grep( /^$module$/, ( @denied_grabbers ) );
Branch: 1 branch
BranchTrueFalseTotal
if grep /^$module$/, @denied_grabbers 0 0 0
59 0 use_module( $module );
60 0 my $m = new $module;
61 0 ▶ carp( sprintf "Duplicate grabber alias: %s!", $m->alias ) if exists $grabber_modules{$m->alias};
Branch: 1 branch
BranchTrueFalseTotal
if exists $Geo::Ov2::Grabber::grabber_modules{$m->alias} 0 0 0
62 0 $grabber_modules{$m->alias} = $m;
63 }
64 0 $OVG=$self;
65 0 return $self;
66 }
67  
68  
69 0 ▶sub grab_all() {
Subroutine grab_all: not called CC=3 SCAR=24.8
Pod undocumented
70 0 my $self = shift;
71 0 my $error = 0;
72 0 foreach my $i ( values %grabber_modules ) {
73 0 ▶ $error = ( $error or $i->grab );
Condition0%0/3
$error || $i->grab
l!l&&r!l&&!r
000
MC/DC0%0/2
$error || $i->grab
$error $i->grab
Truth table0%0/3
A || B
A= $errorB= $i->grab
ABresult
1X1
011
000
74 }
75 0 return $error;
76 }
77  
78 0 ▶sub grab($) {
Subroutine grab: not called CC=1 SCAR=6.9
Pod undocumented
79 0 my $self = shift;
80 0 my $grabber = shift;
81 0 return $grabber_modules{$grabber}->grab;
82 }
83  
84 0 ▶sub list_grabbers {
Subroutine list_grabbers: not called CC=1 SCAR=6.9
Pod undocumented
85 0 return keys %grabber_modules;
86 }
87  
88 =head1 AUTHOR
89  
90 hPa, C<< <hpa at suteren.net> >>
91  
92 =head1 BUGS
93  
94 Please report any bugs or feature requests to
95 C<bug-geo-ov2-grabber at rt.cpan.org>, or through the web interface at
96 L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Geo-Ov2-Grabber>.
97 I will be notified, and then you'll automatically be notified of progress on
98 your bug as I make changes.
99  
100 =head1 SUPPORT
101  
102 You can find documentation for this module with the perldoc command.
103  
104 perldoc Geo::Ov2::Grabber
105  
106 You can also look for information at:
107  
108 =over 4
109  
110 =item * AnnoCPAN: Annotated CPAN documentation
111  
112 L<http://annocpan.org/dist/Geo-Ov2-Grabber>
113  
114 =item * CPAN Ratings
115  
116 L<http://cpanratings.perl.org/d/Geo-Ov2-Grabber>
117  
118 =item * RT: CPAN's request tracker
119  
120 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Geo-Ov2-Grabber>
121  
122 =item * Search CPAN
123  
124 L<http://search.cpan.org/dist/Geo-Ov2-Grabber>
125  
126 =back
127  
128 =head1 ACKNOWLEDGEMENTS
129  
130 =head1 COPYRIGHT & LICENSE
131  
132 Copyright 2007 hPa, all rights reserved.
133  
134 This program is free software; you can redistribute it and/or modify it
135 under the same terms as Perl itself.
136  
137 =cut
138  
139 2 1; # End of Geo::Ov2::Grabber
↑ Summary lib/Geo/Ov2/grab.poi.cz.pl »