[BACK]Return to API.pm CVS log [TXT][DIR] Up to [local] / todotxt / Text-Todo-REST-API / lib / Text / Todo / REST

Diff for /todotxt/Text-Todo-REST-API/lib/Text/Todo/REST/API.pm between version 1.13 and 1.18

version 1.13, 2010/01/26 04:30:13 version 1.18, 2010/02/13 21:48:28
Line 1 
Line 1 
 package Text::Todo::REST::API;  package Text::Todo::REST::API;
   
 # $AFresh1: API.pm,v 1.12 2010/01/26 03:51:49 andrew Exp $  # $AFresh1: API.pm,v 1.17 2010/01/31 03:10:39 andrew Exp $
   
 use warnings;  use warnings;
 use strict;  use strict;
Line 104 
Line 104 
         }          }
   
         if ( $options{action} eq 'entry' && @{ $options{args} } ) {          if ( $options{action} eq 'entry' && @{ $options{args} } ) {
             $options{entry} = shift @{ $options{args} };              $options{action} .= q{_} . lc shift @{ $options{args} };
             if ( @{ $options{args} } ) {  
                 $options{action} .= q{_} . lc shift @{ $options{args} };  
             }  
         }          }
   
         push @{ $options{args} }, @args;          push @{ $options{args} }, @args;
   
         $options{list}          my $list = $self->_todo->file( $options{list} );
             = defined $options{list} ? $options{list} : 'todo_file';  
   
           my $suffix = $self->_suffix || q{};
           if ( $list !~ / \Q$suffix\E $/ixms ) {
               $list .= $suffix;
           }
   
           $options{list} = $list;
   
         if ( $options{format} ) {          if ( $options{format} ) {
             $format_of{ ident $self } = $options{format};              $format_of{ ident $self } = $options{format};
             delete $options{format};              delete $options{format};
Line 157 
Line 160 
         my ( $self, $path ) = @_;          my ( $self, $path ) = @_;
   
         my %options = (          my %options = (
             list   => undef,  
             action => undef,              action => undef,
               list   => undef,
               entry  => undef,
             args   => [],              args   => [],
         );          );
   
Line 169 
Line 173 
             $options{format} = $1;              $options{format} = $1;
         }          }
   
         ( $options{list}, $options{action}, @{ $options{args} } ) = split '/',          ( $options{list}, $options{action},
             $path;            @{ $options{args} } ) = split '/', $path;
   
         if ( $options{list} ) {          if (!defined $options{action}) {
             $options{action} ||= 'list';              if ( $options{list} ) {
                   $options{action} = 'list';
             my $suffix = $self->_suffix;  
   
             if ( ( lc $options{list} ) eq 'files' ) {  
                 $options{action} = lc $options{list};  
                 $options{list}   = q{};  
             }              }
             elsif ( $self->_todo->file( $options{list} ) ) {              else {
                 $options{list} = $self->_todo->file( $options{list} );                  $options{action} = 'files';
             }              }
         }          }
   
         if ( @{ $options{args} } && ( lc $options{args}[0] ) eq 'entry' ) {          $options{action} = lc( $options{action} );
             $options{action} = lc shift @{ $options{args} };  
           if ($options{action} eq 'entry'
            || $options{action} eq 'tags'
           ) {
               $options{ $options{action} } = shift @{ $options{args} };
         }          }
   
         return %options;          return %options;

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.18

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>