Changeset 1527
- Timestamp:
- 08/20/06 21:13:32
- Files:
-
- branches/hackathon-summary/plagger/lib/Plagger/Entry.pm (modified) (1 diff)
- branches/hackathon-summary/plagger/lib/Plagger/Feed.pm (modified) (1 diff)
- branches/hackathon-summary/plagger/lib/Plagger/Text.pm (moved) (moved from branches/hackathon-summary/plagger/lib/Plagger/Content.pm) (1 diff)
- branches/hackathon-summary/plagger/lib/Plagger/Thing.pm (modified) (3 diffs)
- branches/hackathon-summary/plagger/t/core/text.t (moved) (moved from branches/hackathon-summary/plagger/t/core/content.t) (1 diff)
- branches/hackathon-summary/plagger/t/plugins/Filter-FetchEnclosure/fetch.t (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/hackathon-summary/plagger/lib/Plagger/Entry.pm
r1524 r1527 4 4 use base qw( Plagger::Thing ); 5 5 __PACKAGE__->mk_accessors(qw( tags link feed_link id rate icon meta source )); 6 __PACKAGE__->mk_ content_accessors(qw( title author summary body ));6 __PACKAGE__->mk_text_accessors(qw( title author summary body )); 7 7 __PACKAGE__->mk_date_accessors(qw( date )); 8 8 branches/hackathon-summary/plagger/lib/Plagger/Feed.pm
r1524 r1527 4 4 use base qw( Plagger::Thing ); 5 5 __PACKAGE__->mk_accessors(qw( link url image language tags meta type source_xml aggregator )); 6 __PACKAGE__->mk_ content_accessors(qw( description author title ));6 __PACKAGE__->mk_text_accessors(qw( description author title )); 7 7 __PACKAGE__->mk_date_accessors(qw( updated )); 8 8 branches/hackathon-summary/plagger/lib/Plagger/Text.pm
r1525 r1527 1 package Plagger:: Content;1 package Plagger::Text; 2 2 use strict; 3 3 use base qw( Class::Accessor::Fast ); branches/hackathon-summary/plagger/lib/Plagger/Thing.pm
r1521 r1527 3 3 use base qw( Class::Accessor::Fast ); 4 4 5 use Plagger:: Content;5 use Plagger::Text; 6 6 7 7 sub has_tag { … … 45 45 } 46 46 47 sub mk_ content_accessors {47 sub mk_text_accessors { 48 48 my $class = shift; 49 49 for my $key (@_) { … … 52 52 my $obj = shift; 53 53 if (@_) { 54 my $ content = $_[0];55 unless (ref($ content)) {56 $ content = Plagger::Content->new_from_text($content);54 my $text = $_[0]; 55 unless (ref($text)) { 56 $text = Plagger::Text->new_from_text($text); 57 57 } 58 $obj->{$key} = $ content;58 $obj->{$key} = $text; 59 59 } else { 60 60 return $obj->{$key}; branches/hackathon-summary/plagger/t/core/text.t
r1521 r1527 6 6 run { 7 7 my $block = shift; 8 my $ content = Plagger::Content->new_from_text($block->input);9 my $test = { type => $ content->type, plaintext => $content->plaintext };8 my $text = Plagger::Text->new_from_text($block->input); 9 my $test = { type => $text->type, plaintext => $text->plaintext }; 10 10 is_deeply $test, $block->expected, $block->name; 11 11 } branches/hackathon-summary/plagger/t/plugins/Filter-FetchEnclosure/fetch.t
r1524 r1527 10 10 } 11 11 12 $SIG{__WARN__} = \&Carp::cluck;13 $SIG{__DIE__} = \&Carp::confess;14 12 plan tests => 2; 15 13
