line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Toader::Render::supportedBackends; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
19776
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
5
|
1
|
|
|
1
|
|
6
|
use base 'Error::Helper'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
872
|
|
6
|
1
|
|
|
1
|
|
1466
|
use Toader::Render::supportedObjects; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
72
|
|
7
|
1
|
|
|
1
|
|
883
|
use Module::List qw(list_modules); |
|
1
|
|
|
|
|
32671
|
|
|
1
|
|
|
|
|
366
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Toader::Render::supportedBackends - This checks if the backend is supported or not. |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 VERSION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Version 0.1.0 |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=cut |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $VERSION = '0.1.0'; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 METHODS |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head2 new |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
This initiates the object. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
There is no reason to check for any errors |
30
|
|
|
|
|
|
|
as this module will not throw any errors |
31
|
|
|
|
|
|
|
upon initilization. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
my $foo=Toader::Render::supportedBackends->new; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub new{ |
38
|
0
|
|
|
0
|
1
|
|
my $self={ |
39
|
|
|
|
|
|
|
error=>undef, |
40
|
|
|
|
|
|
|
errorString=>'', |
41
|
|
|
|
|
|
|
perror=>undef, |
42
|
|
|
|
|
|
|
soc=>Toader::Render::supportedObjects->new, |
43
|
|
|
|
|
|
|
errorExtra=>{ |
44
|
|
|
|
|
|
|
flags=>{ |
45
|
|
|
|
|
|
|
1=>'noObj', |
46
|
|
|
|
|
|
|
2=>'unsupportedObj', |
47
|
|
|
|
|
|
|
}, |
48
|
|
|
|
|
|
|
}, |
49
|
|
|
|
|
|
|
}; |
50
|
0
|
|
|
|
|
|
bless $self; |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
return $self; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 checkBE |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
This checks if the specified for the object exists or not. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
One argument is required and that is the object to check. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
my $results=$foo->checkBE( $obj ); |
62
|
|
|
|
|
|
|
if ( $foo->error ){ |
63
|
|
|
|
|
|
|
warn( 'Error:'.$foo->error.': '.$foo->errorString ); |
64
|
|
|
|
|
|
|
}else{ |
65
|
|
|
|
|
|
|
if ( $results ){ |
66
|
|
|
|
|
|
|
print "It is supported.\n"; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub checkBE{ |
73
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
74
|
0
|
|
|
|
|
|
my $obj=$_[1]; |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
$self->errorblank; |
77
|
|
|
|
|
|
|
|
78
|
0
|
0
|
|
|
|
|
if ( ! defined( $obj ) ){ |
79
|
0
|
|
|
|
|
|
$self->{error}=1; |
80
|
0
|
|
|
|
|
|
$self->{errorString}='No object defined'; |
81
|
0
|
|
|
|
|
|
$self->warn; |
82
|
0
|
|
|
|
|
|
return undef; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
0
|
0
|
|
|
|
|
if ( ! $self->{soc}->isSupported( $obj ) ){ |
86
|
0
|
|
|
|
|
|
$self->{error}=2; |
87
|
0
|
|
|
|
|
|
$self->{errorString}='"'.ref($obj).'" is not a supported object'; |
88
|
0
|
|
|
|
|
|
$self->warn; |
89
|
0
|
|
|
|
|
|
return undef; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
#get what should be rendered |
93
|
0
|
|
|
|
|
|
my $renderUsing=$obj->renderUsing; |
94
|
0
|
|
|
|
|
|
my %modules=list_modules( $renderUsing.'::', { list_modules=>1 } ); |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
#get the renderer |
97
|
0
|
|
|
|
|
|
my $renderer=undef; |
98
|
0
|
|
|
|
|
|
$renderer=$obj->rendererGet; |
99
|
0
|
0
|
|
|
|
|
if ( $obj->error ){ |
100
|
0
|
|
|
|
|
|
$self->{error}=3; |
101
|
0
|
|
|
|
|
|
$self->{errorString}='The object, "'.ref($obj).'", errored. error="'. |
102
|
|
|
|
|
|
|
$obj->error.'" errorString="'.$obj->errorString.'"'; |
103
|
0
|
|
|
|
|
|
return undef; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 ERROR CODES |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head2 1, noObj |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
No object defined. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head2 2, unsupportedObj |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Unsupported object type. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 AUTHOR |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Zane C. Bowers-Hadley, C<< >> |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 BUGS |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
125
|
|
|
|
|
|
|
the web interface at L. I will |
126
|
|
|
|
|
|
|
be notified, and then you'll automatically be notified of progress on your bug as I make |
127
|
|
|
|
|
|
|
changes. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head1 SUPPORT |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
perldoc Toader::Render::supportedBackends |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
You can also look for information at: |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=over 4 |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
L |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
L |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=item * CPAN Ratings |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
L |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=item * Search CPAN |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
L |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=back |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
Copyright 2013. Zane C. Bowers-Hadley. |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
164
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
165
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=cut |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
1; # End of Toader::Render::supportedBackends |