=================================================================== RCS file: /cvs/todotxt/Text-Todo/lib/Text/Todo/Entry.pm,v retrieving revision 1.8 retrieving revision 1.11 diff -u -r1.8 -r1.11 --- todotxt/Text-Todo/lib/Text/Todo/Entry.pm 2010/01/08 04:50:41 1.8 +++ todotxt/Text-Todo/lib/Text/Todo/Entry.pm 2010/01/09 07:08:45 1.11 @@ -1,6 +1,6 @@ package Text::Todo::Entry; -# $RedRiver: Entry.pm,v 1.7 2009/07/13 18:05:50 andrew Exp $ +# $RedRiver: Entry.pm,v 1.9 2010/01/08 17:41:56 andrew Exp $ use warnings; use strict; @@ -46,16 +46,6 @@ }; } - # Aliases - sub app { append(@_) } - sub change { _update_entry(@_) } - sub depri { _set_priority( @_, '' ) } - sub do { complete(@_) } - sub done { completed(@_) } - sub dp { depri(@_) } - sub p { priority(@_) } - sub prep { prepend(@_) } - sub pri { priority(@_) } sub replace { _update_entry(@_) } sub new { @@ -108,7 +98,9 @@ return $text_of{$ident}; } - sub _set_priority { + sub depri { pri( @_, '' ) } + + sub pri { my ( $self, $new_pri ) = @_; my $ident = ident($self); @@ -125,20 +117,9 @@ my ( $self, $new_pri ) = @_; my $ident = ident($self); - if ($new_pri) { - return $self->_set_priority($new_pri); - } - return $priority_of{$ident}; } - sub completed { - my ($self) = @_; - my $ident = ident($self); - - return $completion_status_of{$ident}; - } - sub prepend { my ( $self, $addition ) = @_; @@ -147,8 +128,8 @@ $new =~ s/$priority_completion_regex//xms; - if ( $self->completed ) { - push @new, $self->completed; + if ( $self->done ) { + push @new, $self->done; } if ( $self->priority ) { @@ -167,11 +148,11 @@ return $self->_update_entry( join q{ }, $self->text, $addition ); } - sub complete { + sub do { my ($self) = @_; my $ident = ident($self); - if ( $self->completed ) { + if ( $self->done ) { return 1; } @@ -180,6 +161,13 @@ return $self->prepend(); } + sub done { + my ($self) = @_; + my $ident = ident($self); + + return $completion_status_of{$ident}; + } + } 1; # Magic true value required at end of module __END__ @@ -233,16 +221,19 @@ =head2 in_project -=head2 change +=head2 replace =head2 prepend =head2 append -=head2 complete +=head2 do -=head2 completed +=head2 done +=head2 pri + +=head2 depri =head1 DIAGNOSTICS