App-JobLog

 view release on metacpan or  search on metacpan

Changelog  view on Meta::CPAN

  * added Module::Build prerequisite so install will succeed on a clean Ubuntu box
  * fixed empty log bug in add command

1.011     2011-03-16 05:44:21 America/New_York
  * cosmetic changes to info command
  * further improvement to perldocs
  * added time zone configuration parameter with Cygwin test so the Cygwin smoke test will pass

1.010     2011-03-15 17:26:53 America/New_York
  * fixed "last/this week" bug due to DateTime choosing Monday as first day in week
  * fixed edit command so checksums are calculated correctly and backup is only saved in case of change
  * fixed TimeGrammar; "jan 1 - 10" and such are properly handled
  * fixed TimeGrammar; '2010' and such are properly handled
  * fixed bug caused by end of month wrapping in DateTime
  * changing the options for the info command so minimal information is returned by default
  * improved text wrapping of full description for commands
  * finished text of info command

1.009     2011-03-13 15:14:27 America/New_York
  * changed date format code to show year if span in question stretches over more than one year
  * unrolled slow loop in summary after Devel::NYTProf profiling

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

numbing to scroll through it for anything but the most recent events, and with a job log what you usually want
isn't time stamps but durations. So in addition to a logging facility we want a report extraction facility. Finally,
we often want to filter out particular activities and categorize them in various ways, so along with the time stamps
and descriptions we want tags. That's about it. Besides this minimal functionality we want the log to impose as few
restrictions as possible so that we don't need to think about how it works. We don't want to worry about characters
with special valence so the log has to handle its own escaping of spaces and colons and so forth. We don't want to
worry about character encoding so the log has to be in Unicode (utf8).

B<App::JobLog> keeps its documents, by default, in a hidden directory in your home directory called F<.joblog/>. These
documents are a README file explaining to anyone who stumbles across the directory what it's function is, a log, called
F<log>, a configuration file, called F<config.ini>, a vacation file, called F<vacation>, and perhaps log backups.

To perform any action with B<App::JobLog> one invokes the executable with a command and a list of options. These commands
are listed below.

=head2 COMMANDS

=over 8

=item B<help>

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

            my $md5  = Digest::MD5->new;
            my $md51 = $md5->addfile($fh)->hexdigest;
            system "$editor $log";
            $fh = FileHandle->new($log);
            my $md52 = $md5->reset->addfile($fh)->hexdigest;

            if ( $md51 ne $md52 ) {
                $fh = FileHandle->new( "$log.bak", 'w' );
                copy( $fn, $fh );
                $fh->close;
                say "saved backup log in $log.bak";
                my $errors = App::JobLog::Log->new->validate;
                _error_report($errors);
            }
            else {
                unlink $fn;
            }
        }
        else {
            say 'nothing in log to edit';
        }

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

 Monday,  7 March, 2011
   8:01 - 8:05 am  0.05  bar, foo  something to add; and still more                                                                                                  
 
   TOTAL HOURS 0.05
   bar         0.05
   foo         0.05
 houghton@NorthernSpy:~$ job e

A text editor opens up displaying the log. Appropriate edits are performed. The user saves and quits.

 saved backup log in /home/houghton/.joblog/log.bak
 log is valid
 houghton@NorthernSpy:~$ 

=head1 DESCRIPTION

Generally you won't have need to modify the log except through L<App::JobLog::Command::add>, L<App::JobLog::Command::done>,
L<App::JobLog::Command::modify>, or L<App::JobLog::Command::resume>. There will sometimes be glitches, though: you will
be away from the log when you do something or you will quit for the day without having punched out with L<App::JobLog::Command::done>.
This is when you need B<App::JobLog::Command::edit>.



( run in 0.573 second using v1.01-cache-2.11-cpan-49f99fa48dc )