App-JobLog

 view release on metacpan or  search on metacpan

Changelog  view on Meta::CPAN


1.030     2012-12-27 20:05:35 EST5EDT
  * silenced some Perl::Critic warnings
  * fixed error when summarizing a period with an open task

1.029     2012-03-06 07:53:56 EST5EDT
  * improved layout of same-minute events in summary

1.028     2012-03-04 12:51:08 EST5EDT
  * fixed failure to reverse note list when scanning from end of log
  * fixed warning thrown by App::JobLog::Log::_scan_for_previous_note()

1.027     2012-03-03 12:49:40 EST5EDT
  * made info command more up-to-date
  * made time grammar understand future expressions like tomorrow and next
    week
  * improved last command so it properly reports events spanning the day
    boundary

1.026     2012-02-14 20:17:51 EST5EDT
  * tinkered with app.t to get the test to pass on machines on which wrapping
    is busted

1.025     2012-02-13 15:40:30 EST5EDT
  * got rid of annoying "next from when" warning which was showing up under
    OS X Perl

1.024     2012-02-12 11:59:53 EST5EDT
  * put error handling into App::JobLog::Log::Format::wrap

1.023     2012-02-06 17:10:17 EST5EDT
  * fixed warning thrown during summarization when last event is open
  * removed some dead code
  * various refactorings related to creating App::JobLog::Note class
  * addition of the note command
  * numerous small bug fixes

1.022     2011-12-07 20:41:01 EST5EDT
  * replaced deprecated "given" construct everywhere with "for"

1.021     2011-11-23 06:15:30 EST5EDT
  * improved help doc for truncate command

lib/App/JobLog/Command/info.pm  view on Meta::CPAN

directory. If @{[DIRECTORY()]} is set, however, it will keep its files here. This is mostly useful for
testing, though if you find F<.joblog> already is in use by some other application you can use this variable
to prevent collisions. Collisions will only occur if the files F<log> or F<config.ini> exist in this
directory, and B<Job Log> will only alter these files if you append an event to the log or modify some
configuration parameters.

All other configuration is done through the B<@{[App::JobLog::Command::configure->name]}> command.

==head1 Time Expressions

B<Job Log> goes to considerable trouble to interpret whatever time expressions you might throw at it.
For example, it understands all of the following:

   1
   11/24 to today
   17 dec, 2024
   1 april, 2022 to 1-23-2002
   2023.6.5 - 10.26.2020
   2-22 till yesterday
   24 apr
   27 november, 1995 through 10

t/Log.t  view on Meta::CPAN

    my $log = App::JobLog::Log->new;
    my $date =
      DateTime->new( year => 2011, month => 1, day => 1, time_zone => tz );
    my $end = $date->clone->add( days => 1 )->subtract( seconds => 1 );
    is(
        exception {
            my $events = $log->find_events( $date, $end );
            ok( @$events == 0, 'no events in empty log' );
        },
        undef,
        'no error thrown with empty log',
    );
    is(
        exception {
            $log->append_event( time => $date, description => 'test event' );
            $log->close;
            my $events = $log->find_events( $date, $end );
            ok( @$events == 1, 'added event appears in empty log' );
        },
        undef,
        'added event to empty log'

t/Notes.t  view on Meta::CPAN

                            time_zone => tz
                        );
                        $log->append_event( description => 'test event' );
                        ($ll) = $log->last_note;
                        is( $ll->data->description->[0], 'bar',
'found last note correctly when there was an intervening event'
                        );
                    }
                },
                undef,
                'no error thrown when retrieving last note'
            );
        },
        undef,
        'no error thrown when appending note'
    );
};

subtest 'parsing a log' => sub {

    # make a log
    <<END > io log;
# 2011/01/01
2011  1  1  2 22 30<NOTE>:first note
2011  1  1  2 23 30::foo



( run in 0.263 second using v1.01-cache-2.11-cpan-496ff517765 )