[Templates-cvs] cvs commit: Template2/lib/Template Base.pm

cvs@template-toolkit.org cvs@template-toolkit.org
Mon, 12 Jan 2004 11:00:23 +0000


cvs         04/01/12 11:00:23

  Modified:    lib/Template Base.pm
  Log:
  * added version() method
  
  Revision  Changes    Path
  2.65      +18 -5     Template2/lib/Template/Base.pm
  
  Index: Base.pm
  ===================================================================
  RCS file: /template-toolkit/Template2/lib/Template/Base.pm,v
  retrieving revision 2.64
  retrieving revision 2.65
  diff -u -r2.64 -r2.65
  --- Base.pm	2004/01/06 18:31:15	2.64
  +++ Base.pm	2004/01/12 11:00:22	2.65
  @@ -18,7 +18,7 @@
   #
   #------------------------------------------------------------------------
   #
  -#   $Id: Base.pm,v 2.64 2004/01/06 18:31:15 abw Exp $
  +#   $Id: Base.pm,v 2.65 2004/01/12 11:00:22 abw Exp $
   #
   #========================================================================
    
  @@ -30,7 +30,7 @@
   use vars qw( $VERSION );
   use Template::Constants;
   
  -$VERSION = sprintf("%d.%02d", q$Revision: 2.64 $ =~ /(\d+)\.(\d+)/);
  +$VERSION = sprintf("%d.%02d", q$Revision: 2.65 $ =~ /(\d+)\.(\d+)/);
   
   
   #------------------------------------------------------------------------
  @@ -137,6 +137,19 @@
       print STDERR "[$pkg] $msg";
   }
   
  +#------------------------------------------------------------------------
  +# version()
  +#
  +# Returns the current version number.
  +#------------------------------------------------------------------------
  +
  +sub version {
  +    my $self = shift;
  +    my $class = ref $self || $self;
  +    no strict 'refs';
  +    return ${"${class}::VERSION"};
  +}
  +
   
   1;
   
  @@ -274,8 +287,8 @@
   
   =head1 VERSION
   
  -2.63, distributed as part of the
  -Template Toolkit version 2.11, released on 06 January 2004.
  +2.64, distributed as part of the
  +Template Toolkit version 2.11b, released on 07 January 2004.
   
   =head1 COPYRIGHT
   
  @@ -287,4 +300,4 @@
   
   =head1 SEE ALSO
   
  -L<Template|Template>
  \ No newline at end of file
  +L<Template|Template>