blib/lib/XML/RSS/Private/Output/V1_0.pm

filter: Statementstmt 83.3% 10 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 87.5% 14 / 16 CC 1 SCAR 0.7
CC
1
Cov
83%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« blib/lib/XML/RSS/Private/Output/V0_91.pm ↑ Summary blib/lib/XML/RSS/Private/Output/V2_0.pm »
1 package XML::RSS::Private::Output::V1_0;
2 $XML::RSS::Private::Output::V1_0::VERSION = '1.60';
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use vars (qw(@ISA));
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use XML::RSS::Private::Output::Base;
Subroutine BEGIN: called CC=1 SCAR=2.6
9 use XML::RSS::Private::Output::Roles::ModulesElems;
10  
11 @ISA = (qw(XML::RSS::Private::Output::Roles::ModulesElems XML::RSS::Private::Output::Base));
12  
13 sub _get_top_elem_about {
14 my ($self, $tag, $about_sub) = @_;
15 return ' rdf:about="' . $self->_encode($about_sub->()) . '"';
16 }
17  
18 sub _out_textinput_rss_1_0_elems {
19 my $self = shift;
20  
21 $self->_out_dc_elements($self->textinput());
22  
23 # Ad-hoc modules
24 # TODO : Should this follow the %rdf_resources conventions of the items'
25 # and channel's modules' support ?
26 while (my ($url, $prefix) = each %{$self->_modules()}) {
27 next if $prefix =~ /^(dc|syn|taxo)$/;
28 while (my ($el, $value) = each %{$self->textinput($prefix) || {}}) {
29 $self->_out_ns_tag($prefix, $el, $value);
30 }
31 }
32 }
33  
34 sub _get_rdf_decl_open_tag {
35 return "<rdf:RDF\n";
36 }
37  
38 sub _calc_prefer_dc {
39 return 1;
40 }
41  
42 sub _get_first_rdf_decl_mappings {
43 return (
44 ["rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"],
45 [undef, "http://purl.org/rss/1.0/"]
46 );
47 }
48  
49 sub _out_image_dc_elements {
50 my $self = shift;
51 return $self->_out_dc_elements($self->image());
52 }
53  
54 sub _out_item_1_0_tags {
55 my ($self, $item) = @_;
56  
57 $self->_out_dc_elements($item);
58  
59 # Taxonomy module
60 $self->_output_taxo_topics($item);
61 }
62  
63 sub _output_rss_middle {
64 my $self = shift;
65  
66 # PICS rating - Dublin Core has not decided how to incorporate PICS ratings yet
67 #$$output .= '<rss091:rating>'.$self->{channel}->{rating}.'</rss091:rating>'."\n"
68 #$if $self->{channel}->{rating};
69  
70 $self->_out_copyright();
71  
72 # publication date
73 $self->_out_defined_tag("dc:date", $self->_calc_dc_date());
74  
75 # external CDF URL
76 #$output .= '<rss091:docs>'.$self->{channel}->{docs}.'</rss091:docs>'."\n"
77 #if $self->{channel}->{docs};
78  
79 $self->_out_editors;
80  
81 $self->_out_all_modules_elems;
82  
83 $self->_out_seq_items();
84  
85 if ($self->_is_image_defined()) {
86 $self->_out('<image rdf:resource="' .
87 $self->_encode($self->image('url')) . "\" />\n"
88 );
89 }
90  
91 if (defined(my $textinput_link = $self->textinput('link'))) {
92 $self->_out('<textinput rdf:resource="'
93 . $self->_encode($textinput_link) . "\" />\n"
94 );
95 }
96  
97 $self->_end_channel;
98  
99 $self->_output_main_elements;
100 }
101  
102 sub _get_end_tag {
103 return "rdf:RDF";
104 }
105  
106 1;
107  
108 __END__
109  
110 =pod
111  
112 =head1 VERSION
113  
114 version 1.60
115  
116 =head1 AUTHOR
117  
118 Shlomi Fish <shlomif@cpan.org>
119  
120 =head1 COPYRIGHT AND LICENSE
121  
122 This software is copyright (c) 2001 by Various.
123  
124 This is free software; you can redistribute it and/or modify it under
125 the same terms as the Perl 5 programming language system itself.
126  
127 =head1 BUGS
128  
129 Please report any bugs or feature requests on the bugtracker website
130 L<https://github.com/shlomif/perl-XML-RSS/issues>
131  
132 When submitting a bug or request, please include a test-file or a
133 patch to an existing test-file that illustrates the bug or desired
134 feature.
135  
136 =for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan
137  
138 =head1 SUPPORT
139  
140 =head2 Perldoc
141  
142 You can find documentation for this module with the perldoc command.
143  
144 perldoc XML::RSS::Private::Output::V1_0
145  
146 =head2 Websites
147  
148 The following websites have more information about this module, and may be of help to you. As always,
149 in addition to those websites please use your favorite search engine to discover more resources.
150  
151 =over 4
152  
153 =item *
154  
155 MetaCPAN
156  
157 A modern, open-source CPAN search engine, useful to view POD in HTML format.
158  
159 L<https://metacpan.org/release/XML-RSS>
160  
161 =item *
162  
163 Search CPAN
164  
165 The default CPAN search engine, useful to view POD in HTML format.
166  
167 L<http://search.cpan.org/dist/XML-RSS>
168  
169 =item *
170  
171 RT: CPAN's Bug Tracker
172  
173 The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN.
174  
175 L<https://rt.cpan.org/Public/Dist/Display.html?Name=XML-RSS>
176  
177 =item *
178  
179 AnnoCPAN
180  
181 The AnnoCPAN is a website that allows community annotations of Perl module documentation.
182  
183 L<http://annocpan.org/dist/XML-RSS>
184  
185 =item *
186  
187 CPAN Ratings
188  
189 The CPAN Ratings is a website that allows community ratings and reviews of Perl modules.
190  
191 L<http://cpanratings.perl.org/d/XML-RSS>
192  
193 =item *
194  
195 CPANTS
196  
197 The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution.
198  
199 L<http://cpants.cpanauthors.org/dist/XML-RSS>
200  
201 =item *
202  
203 CPAN Testers
204  
205 The CPAN Testers is a network of smoke testers who run automated tests on uploaded CPAN distributions.
206  
207 L<http://www.cpantesters.org/distro/X/XML-RSS>
208  
209 =item *
210  
211 CPAN Testers Matrix
212  
213 The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms.
214  
215 L<http://matrix.cpantesters.org/?dist=XML-RSS>
216  
217 =item *
218  
219 CPAN Testers Dependencies
220  
221 The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution.
222  
223 L<http://deps.cpantesters.org/?module=XML::RSS>
224  
225 =back
226  
227 =head2 Bugs / Feature Requests
228  
229 Please report any bugs or feature requests by email to C<bug-xml-rss at rt.cpan.org>, or through
230 the web interface at L<https://rt.cpan.org/Public/Bug/Report.html?Queue=XML-RSS>. You will be automatically notified of any
231 progress on the request by the system.
232  
233 =head2 Source Code
234  
235 The code is open to the world, and available for you to hack on. Please feel free to browse it and play
236 with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull
237 from your repository :)
238  
239 L<https://github.com/shlomif/perl-XML-RSS>
240  
241 git clone git://github.com/shlomif/perl-XML-RSS.git
242  
243 =cut
« blib/lib/XML/RSS/Private/Output/V0_91.pm ↑ Summary blib/lib/XML/RSS/Private/Output/V2_0.pm »