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.62';
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 (["rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"],
44 [undef, "http://purl.org/rss/1.0/"]);
45 }
46  
47 sub _out_image_dc_elements {
48 my $self = shift;
49 return $self->_out_dc_elements($self->image());
50 }
51  
52 sub _out_item_1_0_tags {
53 my ($self, $item) = @_;
54  
55 $self->_out_dc_elements($item);
56  
57 # Taxonomy module
58 $self->_output_taxo_topics($item);
59 }
60  
61 sub _output_rss_middle {
62 my $self = shift;
63  
64 # PICS rating - Dublin Core has not decided how to incorporate PICS ratings yet
65 #$$output .= '<rss091:rating>'.$self->{channel}->{rating}.'</rss091:rating>'."\n"
66 #$if $self->{channel}->{rating};
67  
68 $self->_out_copyright();
69  
70 # publication date
71 $self->_out_defined_tag("dc:date", $self->_calc_dc_date());
72  
73 # external CDF URL
74 #$output .= '<rss091:docs>'.$self->{channel}->{docs}.'</rss091:docs>'."\n"
75 #if $self->{channel}->{docs};
76  
77 $self->_out_editors;
78  
79 $self->_out_all_modules_elems;
80  
81 $self->_out_seq_items();
82  
83 if ($self->_is_image_defined()) {
84 $self->_out('<image rdf:resource="' . $self->_encode($self->image('url')) . "\" />\n");
85 }
86  
87 if (defined(my $textinput_link = $self->textinput('link'))) {
88 $self->_out('<textinput rdf:resource="' . $self->_encode($textinput_link) . "\" />\n");
89 }
90  
91 $self->_end_channel;
92  
93 $self->_output_main_elements;
94 }
95  
96 sub _get_end_tag {
97 return "rdf:RDF";
98 }
99  
100 1;
101  
102 __END__
103  
104 =pod
105  
106 =encoding UTF-8
107  
108 =head1 VERSION
109  
110 version 1.62
111  
112 =for :stopwords cpan testmatrix url bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan
113  
114 =head1 SUPPORT
115  
116 =head2 Websites
117  
118 The following websites have more information about this module, and may be of help to you. As always,
119 in addition to those websites please use your favorite search engine to discover more resources.
120  
121 =over 4
122  
123 =item *
124  
125 MetaCPAN
126  
127 A modern, open-source CPAN search engine, useful to view POD in HTML format.
128  
129 L<https://metacpan.org/release/XML-RSS>
130  
131 =item *
132  
133 RT: CPAN's Bug Tracker
134  
135 The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN.
136  
137 L<https://rt.cpan.org/Public/Dist/Display.html?Name=XML-RSS>
138  
139 =item *
140  
141 CPANTS
142  
143 The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution.
144  
145 L<http://cpants.cpanauthors.org/dist/XML-RSS>
146  
147 =item *
148  
149 CPAN Testers
150  
151 The CPAN Testers is a network of smoke testers who run automated tests on uploaded CPAN distributions.
152  
153 L<http://www.cpantesters.org/distro/X/XML-RSS>
154  
155 =item *
156  
157 CPAN Testers Matrix
158  
159 The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms.
160  
161 L<http://matrix.cpantesters.org/?dist=XML-RSS>
162  
163 =item *
164  
165 CPAN Testers Dependencies
166  
167 The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution.
168  
169 L<http://deps.cpantesters.org/?module=XML::RSS>
170  
171 =back
172  
173 =head2 Bugs / Feature Requests
174  
175 Please report any bugs or feature requests by email to C<bug-xml-rss at rt.cpan.org>, or through
176 the web interface at L<https://rt.cpan.org/Public/Bug/Report.html?Queue=XML-RSS>. You will be automatically notified of any
177 progress on the request by the system.
178  
179 =head2 Source Code
180  
181 The code is open to the world, and available for you to hack on. Please feel free to browse it and play
182 with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull
183 from your repository :)
184  
185 L<https://github.com/shlomif/perl-XML-RSS>
186  
187 git clone git://github.com/shlomif/perl-XML-RSS.git
188  
189 =head1 AUTHOR
190  
191 Shlomi Fish <shlomif@cpan.org>
192  
193 =head1 BUGS
194  
195 Please report any bugs or feature requests on the bugtracker website
196 L<https://github.com/shlomif/perl-XML-RSS/issues>
197  
198 When submitting a bug or request, please include a test-file or a
199 patch to an existing test-file that illustrates the bug or desired
200 feature.
201  
202 =head1 COPYRIGHT AND LICENSE
203  
204 This software is copyright (c) 2001 by Various.
205  
206 This is free software; you can redistribute it and/or modify it under
207 the same terms as the Perl 5 programming language system itself.
208  
209 =cut
« blib/lib/XML/RSS/Private/Output/V0_91.pm ↑ Summary blib/lib/XML/RSS/Private/Output/V2_0.pm »