Show
Ignore:
Timestamp:
06/12/07 22:20:16 (3 years ago)
Author:
eevee
Message:

Add current revision number to the footer. (#67)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • veekun/trunk/lib/Vee.pm

    r186 r235  
    5454__PACKAGE__->setup; 
    5555 
     56# grab the current revision number, if applicable 
     57__PACKAGE__->cache->{svn_revision} =  
     58    Vee::Utils::timed_exec( 5 => sub { 
     59        open my $fh, '-|', 'svnversion' or return; 
     60        my $revision = <$fh>; 
     61        close $fh; 
     62        $revision =~ s/ \D+ $//gx; 
     63        return $revision; 
     64    } ); 
     65 
    5666{ 
    5767    no strict 'refs'; 
     
    8595=cut 
    8696 
    87 my $cache = {}; 
     97my $cache; 
    8898sub cache { 
     99    $cache ||= {};  # so we can call this function above 
    89100    return $cache; 
    90101}