Changeset 1635
- Timestamp:
- 09/02/06 01:55:14
- Files:
-
- trunk/plagger (modified) (previous)
- trunk/plagger/lib/Plagger/Plugin/Publish/Feed.pm (modified) (4 diffs)
- trunk/plagger/t/plugins/Publish-Feed/atom1-valid.t (modified) (2 diffs)
- trunk/plagger/t/plugins/Publish-Feed/rss2-valid.t (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/lib/Plagger/Plugin/Publish/Feed.pm
r1600 r1635 43 43 my $feed_format = $conf->{format} || 'Atom'; 44 44 45 local $XML::Atom::DefaultVersion = "1.0";46 47 45 # generate feed 48 46 my $feed = XML::Feed->new($feed_format); … … 52 50 $feed->generator("Plagger/$Plagger::VERSION"); 53 51 $feed->description($f->description || ''); 54 $feed->author($f->author) if $f->primary_author; 52 $feed->author( $self->make_author($f->author, $feed_format) ) 53 if $f->primary_author; 55 54 56 55 if ($feed_format eq 'Atom') { … … 78 77 $entry->modified($e->date) if $e->date; 79 78 79 $entry->author( $self->make_author($e->author, $feed_format) ); 80 80 if ($feed_format eq 'RSS') { 81 81 my $author = 'nobody@example.com'; … … 143 143 $path =~ s!\s+!_!g; 144 144 $path; 145 } 146 147 sub make_author { 148 my($self, $author, $feed_format) = @_; 149 150 if ($feed_format eq 'RSS') { 151 my $rfc822 = 'nobody@example.com'; 152 $rfc822 .= ' (' . $author . ')' if $author; 153 return $rfc822; 154 } else { 155 return defined $author ? $author : 'nobody'; 156 } 145 157 } 146 158 trunk/plagger/t/plugins/Publish-Feed/atom1-valid.t
r1467 r1635 2 2 use t::TestPlagger; 3 3 4 test_requires_network;5 4 test_plugin_deps; 6 5 … … 36 35 my $out = `$ENV{HOME}/svn/feedvalidator/src/demo.py $main::output A`; 37 36 like $out, qr/No errors or warnings/; 38
