r31711 - in /trunk/libtemplate-timer-perl: Changes META.yml Makefile.PL README Timer.pm debian/changelog debian/compat debian/control debian/copyright debian/rules t/00-load.t t/eval.t t/pod.t
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Sun Mar 8 15:40:36 UTC 2009
Author: ansgar-guest
Date: Sun Mar 8 15:40:33 2009
New Revision: 31711
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=31711
Log:
* New upstream release.
* Convert debian/copyright to proposed machine-readable format.
The list of contributors for debian/* was taken from the changelog.
* Add myself to Uploaders.
* Add build-dependency on libtest-pod-perl.
* Refresh debian/rules for debhelper 7.
* Bump Standards Version to 3.8.0.
Modified:
trunk/libtemplate-timer-perl/Changes
trunk/libtemplate-timer-perl/META.yml
trunk/libtemplate-timer-perl/Makefile.PL
trunk/libtemplate-timer-perl/README
trunk/libtemplate-timer-perl/Timer.pm
trunk/libtemplate-timer-perl/debian/changelog
trunk/libtemplate-timer-perl/debian/compat
trunk/libtemplate-timer-perl/debian/control
trunk/libtemplate-timer-perl/debian/copyright
trunk/libtemplate-timer-perl/debian/rules
trunk/libtemplate-timer-perl/t/00-load.t
trunk/libtemplate-timer-perl/t/eval.t
trunk/libtemplate-timer-perl/t/pod.t
Modified: trunk/libtemplate-timer-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtemplate-timer-perl/Changes?rev=31711&op=diff
==============================================================================
--- trunk/libtemplate-timer-perl/Changes (original)
+++ trunk/libtemplate-timer-perl/Changes Sun Mar 8 15:40:33 2009
@@ -1,23 +1,37 @@
Revision history for Template::Timer
+Template::Timer is now hosted on github at
+http://github.com/petdance/template-timer/
+
+
+1.00 Fri Mar 6 23:32:49 CST 2009
+====================================
+[ENHANCEMENTS]
+Measurements are now in milliseconds, not seconds.
+
+Now shows nesting level in the notes.
+
+The times are all shown as a summary at the end, not throughout
+the page.
+
+
0.04 Sun Oct 16 22:56:51 CDT 2005
+====================================
+[FIXES]
+When calling
- [FIXES]
- When calling
+ [% PROCESS block_1 + block_2 %]
- [% PROCESS block_1 + block_2 %]
-
- the block names are passed as an array reference to process().
- Template::Timer was assuming that any ref() passed was an object
- and calling ->name on that object. Thanks to Bill Moseley.
+the block names are passed as an array reference to process().
+Template::Timer was assuming that any ref() passed was an object
+and calling ->name on that object. Thanks to Bill Moseley.
0.02 Tue Oct 26 11:08:33 CDT 2004
-
- * First actual working version. Fixed bonheaded typo.
+====================================
+First actual working version. Fixed bonheaded typo.
0.01 Tue Oct 26 09:58:24 CDT 2004
-
- * First rudimentary version. Patches and comments welcome.
-
+====================================
+First rudimentary version. Patches and comments welcome.
Modified: trunk/libtemplate-timer-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtemplate-timer-perl/META.yml?rev=31711&op=diff
==============================================================================
--- trunk/libtemplate-timer-perl/META.yml (original)
+++ trunk/libtemplate-timer-perl/META.yml Sun Mar 8 15:40:33 2009
@@ -1,13 +1,19 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: Template-Timer
-version: 0.04
-version_from: Timer.pm
-installdirs: site
-requires:
+--- #YAML:1.0
+name: Template-Timer
+version: 1.00
+abstract: Rudimentary profiling for Template Toolkit
+license: ~
+author:
+ - Andy Lester <andy at petdance.com>
+generated_by: ExtUtils::MakeMaker version 6.44
+distribution_type: module
+requires:
Template: 0
Test::More: 0
Time::HiRes: 0
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.3.html
+ version: 1.3
+resources:
+ license: http://dev.perl.org/licenses/
+ Repository: http://github.com/petdance/template-timer/
Modified: trunk/libtemplate-timer-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtemplate-timer-perl/Makefile.PL?rev=31711&op=diff
==============================================================================
--- trunk/libtemplate-timer-perl/Makefile.PL (original)
+++ trunk/libtemplate-timer-perl/Makefile.PL Sun Mar 8 15:40:33 2009
@@ -2,7 +2,7 @@
use warnings;
use ExtUtils::MakeMaker;
-WriteMakefile(
+my %parms = (
NAME => 'Template::Timer',
AUTHOR => 'Andy Lester <andy at petdance.com>',
VERSION_FROM => 'Timer.pm',
@@ -16,3 +16,33 @@
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Template-Timer-*' },
);
+
+if ( $ExtUtils::MakeMaker::VERSION ge '6.36' ) {
+ $parms{EXTRA_META} = <<EOF;
+resources:
+ license: http://dev.perl.org/licenses/
+ Repository: http://github.com/petdance/template-timer/
+EOF
+}
+
+
+WriteMakefile( %parms );
+
+sub MY::postamble {
+ my $postamble = <<'MAKE_FRAG';
+.PHONY: tags critic
+
+tags:
+ ctags -f tags --recurse --totals \
+ --exclude=blib \
+ --exclude=.svn \
+ --exclude='*~' \
+ --languages=Perl --langmap=Perl:+.t \
+
+critic:
+ perlcritic -1 -q -profile perlcriticrc Timer.pm t/*.t
+
+MAKE_FRAG
+
+ return $postamble;
+}
Modified: trunk/libtemplate-timer-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtemplate-timer-perl/README?rev=31711&op=diff
==============================================================================
--- trunk/libtemplate-timer-perl/README (original)
+++ trunk/libtemplate-timer-perl/README Sun Mar 8 15:40:33 2009
@@ -41,9 +41,14 @@
make install
-COPYRIGHT AND LICENCE
+COPYRIGHT AND LICENSE
-Copyright (C) 2004 Andy Lester
+Copyright (C) 2004-2009 Andy Lester
This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
+it under the terms of either the GNU Public License v3, or the Artistic
+License 2.0.
+
+ * http://www.gnu.org/copyleft/gpl.html
+
+ * http://www.opensource.org/licenses/artistic-license-2.0.php
Modified: trunk/libtemplate-timer-perl/Timer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtemplate-timer-perl/Timer.pm?rev=31711&op=diff
==============================================================================
--- trunk/libtemplate-timer-perl/Timer.pm (original)
+++ trunk/libtemplate-timer-perl/Timer.pm Sun Mar 8 15:40:33 2009
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 0.04
+Version 1.00
=cut
-our $VERSION = '0.04';
+our $VERSION = '1.00';
=head1 SYNOPSIS
@@ -23,10 +23,12 @@
Using Template::Timer is simple.
+ use Template::Timer;
+
my %config = ( # Whatever your config is
- INCLUDE_PATH => "/my/template/path",
- COMPILE_EXT => ".ttc",
- COMPILE_DIR => "/tmp/tt",
+ INCLUDE_PATH => '/my/template/path',
+ COMPILE_EXT => '.ttc',
+ COMPILE_DIR => '/tmp/tt',
);
if ( $development_mode ) {
@@ -36,19 +38,19 @@
my $template = Template->new( \%config );
Now when you process templates, HTML comments will get embedded in your
-output, which you can easily grep for.
+output, which you can easily grep for. The nesting level is also shown.
- <!-- TIMER START: process mainmenu/mainmenu.ttml -->
- <!-- TIMER START: include mainmenu/cssindex.tt -->
- <!-- TIMER START: process mainmenu/cssindex.tt -->
- <!-- TIMER END: process mainmenu/cssindex.tt (0.017279 seconds) -->
- <!-- TIMER END: include mainmenu/cssindex.tt (0.017401 seconds) -->
+ <!-- TIMER START: L1 process mainmenu/mainmenu.ttml -->
+ <!-- TIMER START: L2 include mainmenu/cssindex.tt -->
+ <!-- TIMER START: L3 process mainmenu/cssindex.tt -->
+ <!-- TIMER END: L3 process mainmenu/cssindex.tt (17.279 ms) -->
+ <!-- TIMER END: L2 include mainmenu/cssindex.tt (17.401 ms) -->
....
- <!-- TIMER END: process mainmenu/footer.tt (0.003016 seconds) -->
- <!-- TIMER END: include mainmenu/footer.tt (0.003104 seconds) -->
- <!-- TIMER END: process mainmenu/mainmenu.ttml (0.400409 seconds) -->
+ <!-- TIMER END: L3 process mainmenu/footer.tt (3.016 ms) -->
+ <!-- TIMER END: L2 include mainmenu/footer.tt (3.104 ms) -->
+ <!-- TIMER END: L1 process mainmenu/mainmenu.ttml (400.409 ms) -->
Note that since INCLUDE is a wrapper around PROCESS, calls to INCLUDEs
will be doubled up, and slightly longer than the PROCESS call.
@@ -56,26 +58,67 @@
=cut
use base qw( Template::Context );
-use Time::HiRes (); # Save as much space as we can
+use Time::HiRes ();
+
+our $depth = 0;
+our $epoch = undef;
+our @totals;
foreach my $sub ( qw( process include ) ) {
no strict;
my $super = __PACKAGE__->can("SUPER::$sub") or die;
- *$sub = sub {
- my $self = shift;
- my $template = ref $_[0] eq 'ARRAY'
- ? join( ' + ', @{$_[0]} )
- : ref $_[0] ? $_[0]->name : $_[0];
- my $start = [Time::HiRes::gettimeofday];
- my $data = $super->($self, @_);
- my $elapsed = Time::HiRes::tv_interval($start);
- return <<"END"
-<!-- TIMER START: $sub $template -->
-$data
-<!-- TIMER END: $sub $template ($elapsed seconds) -->
-END
+ *{$sub} = sub {
+ my $self = shift;
+ my $what = shift;
+
+ my $template =
+ ref($what) eq 'ARRAY'
+ ? join( ' + ', @{$what} )
+ : ref($what)
+ ? $what->name
+ : $what;
+
+ my $level;
+ my $processed_data;
+ my $epoch_elapsed_start;
+ my $epoch_elapsed_end;
+ my $now = [Time::HiRes::gettimeofday];
+ my $start = [@{$now}];
+ DOIT: {
+ local $epoch = $epoch ? $epoch : [@{$now}];
+ local $depth = $depth + 1;
+ $level = $depth;
+ $epoch_elapsed_start = _diff_disp($epoch);
+ $processed_data = $super->($self, $what, @_);
+ $epoch_elapsed_end = _diff_disp($epoch);
+ }
+ my $spacing = ' ' x $level;
+ my $level_elapsed = _diff_disp($start);
+ my $ip = uc substr( $sub, 0, 1 );
+ my $start_stats = "L$level $epoch_elapsed_start $spacing$ip $template";
+ my $end_stats = "L$level $epoch_elapsed_end $level_elapsed $spacing$ip $template";
+ @totals = ( $start_stats, @totals, $end_stats );
+ if ( $level > 1 ) {
+ return $processed_data;
+ }
+
+ my $summary = join( "\n",
+ '<!-- SUMMARY',
+ @totals,
+ '-->',
+ '',
+ );
+ @totals = ();
+ return "$processed_data\n$summary\n";
}; # sub
} # for
+
+
+sub _diff_disp {
+ my $starting_point = shift;
+
+ return sprintf( '%7.3f', Time::HiRes::tv_interval($starting_point) * 1000 );
+}
=head1 AUTHOR
@@ -98,10 +141,13 @@
=head1 COPYRIGHT & LICENSE
-Copyright 2005 Andy Lester, All Rights Reserved.
+This library is free software; you can redistribute it and/or modify
+it under the terms of either the GNU Public License v3, or the Artistic
+License 2.0.
-This program is free software; you can redistribute it and/or modify it
-under the same terms as Perl itself.
+ * http://www.gnu.org/copyleft/gpl.html
+
+ * http://www.opensource.org/licenses/artistic-license-2.0.php
=cut
Modified: trunk/libtemplate-timer-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtemplate-timer-perl/debian/changelog?rev=31711&op=diff
==============================================================================
--- trunk/libtemplate-timer-perl/debian/changelog (original)
+++ trunk/libtemplate-timer-perl/debian/changelog Sun Mar 8 15:40:33 2009
@@ -1,5 +1,6 @@
-libtemplate-timer-perl (0.04-2) UNRELEASED; urgency=low
+libtemplate-timer-perl (1.00-1) unstable; urgency=low
+ [ gregor herrmann ]
* Take over for the Debian Perl Group with maintainer's permission
(http://lists.debian.org/debian-perl/2008/06/msg00039.html)
* debian/control: Added: Vcs-Svn field (source stanza); Vcs-Browser
@@ -9,11 +10,18 @@
<rafl at debian.org>); Florian Ragwitz <rafl at debian.org> moved to
Uploaders.
* Add debian/watch.
- * debian/control: Changed: Switched Vcs-Browser field to ViewSVN
- (source stanza).
* debian/control: Added: ${misc:Depends} to Depends: field.
- -- gregor herrmann <gregoa at debian.org> Sun, 15 Jun 2008 17:27:31 +0200
+ [ Ansgar Burchardt ]
+ * New upstream release.
+ * Convert debian/copyright to proposed machine-readable format.
+ The list of contributors for debian/* was taken from the changelog.
+ * Add myself to Uploaders.
+ * Add build-dependency on libtest-pod-perl.
+ * Refresh debian/rules for debhelper 7.
+ * Bump Standards Version to 3.8.0.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org> Sun, 08 Mar 2009 16:40:10 +0100
libtemplate-timer-perl (0.04-1.1) unstable; urgency=low
Modified: trunk/libtemplate-timer-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtemplate-timer-perl/debian/compat?rev=31711&op=diff
==============================================================================
--- trunk/libtemplate-timer-perl/debian/compat (original)
+++ trunk/libtemplate-timer-perl/debian/compat Sun Mar 8 15:40:33 2009
@@ -1,1 +1,1 @@
-4
+7
Modified: trunk/libtemplate-timer-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtemplate-timer-perl/debian/control?rev=31711&op=diff
==============================================================================
--- trunk/libtemplate-timer-perl/debian/control (original)
+++ trunk/libtemplate-timer-perl/debian/control Sun Mar 8 15:40:33 2009
@@ -2,10 +2,11 @@
Section: perl
Priority: optional
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Florian Ragwitz <rafl at debian.org>
-Build-Depends: debhelper (>= 4.0.0)
-Build-Depends-Indep: perl, libtemplate-perl
-Standards-Version: 3.6.2
+Uploaders: Florian Ragwitz <rafl at debian.org>,
+ Ansgar Burchardt <ansgar at 43-1.org>
+Build-Depends: debhelper (>= 7)
+Build-Depends-Indep: perl, libtemplate-perl, libtest-pod-perl (>= 1.14)
+Standards-Version: 3.8.0
Homepage: http://search.cpan.org/dist/Template-Timer/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libtemplate-timer-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libtemplate-timer-perl/
Modified: trunk/libtemplate-timer-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtemplate-timer-perl/debian/copyright?rev=31711&op=diff
==============================================================================
--- trunk/libtemplate-timer-perl/debian/copyright (original)
+++ trunk/libtemplate-timer-perl/debian/copyright Sun Mar 8 15:40:33 2009
@@ -1,16 +1,26 @@
-This package was debianized by Florian Ragwitz <florian at mookooh.org> on
-Mon, 11 Jul 2005 15:01:24 +0200.
+Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=228
+Upstream-Name: Template-Timple
+Upstream-Maintainer: Andy Lester
+Upstream-Source: http://search.cpan.org/dist/Template-Timer/
-It was downloaded from http://search.cpan.org/~petdance/Template-Timer/
+Files: *
+Copyright: © 2004-2009, Andy Lester
+License: GPL-3 | Artistic
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of either the GNU Public License v3, or the Artistic
+ License 2.0.
+ .
+ On Debian GNU/Linux systems, the complete text of the GNU General Public
+ License v3 can be found in `/usr/share/common-licenses/GPL-3' and the
+ Artistic Licence in `/usr/share/common-licenses/Artistic'.
-Copyright Holder: Copyright 2004 Andy Lester, All Rights Reserved.
+Files: debian/*
+Copyright:
+ © 2005-2006, Florian Ragwitz <rafl at debian.org>
+ © 2008, Mark Hymers <mhy at debian.org>
+ © 2008, gregor herrmann <gregoa at debian.org>
+ © 2008, Ansgar Burchardt <ansgar at 43-1.org>
+License: GPL-3 | Artistic
+ It is assumed that all contributors put their work under the same license
+ as the module itself.
-License:
-
-This program is free software; you can redistribute it and/or modify it under
-the same terms as Perl itself.
-
-Perl is distributed under your choice of the GNU General Public License or
-the Artistic License. On Debian GNU/Linux systems, the complete text of the
-GNU General Public License can be found in `/usr/share/common-licenses/GPL'
-and the Artistic Licence in `/usr/share/common-licenses/Artistic'.
Modified: trunk/libtemplate-timer-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtemplate-timer-perl/debian/rules?rev=31711&op=diff
==============================================================================
--- trunk/libtemplate-timer-perl/debian/rules (original)
+++ trunk/libtemplate-timer-perl/debian/rules Sun Mar 8 15:40:33 2009
@@ -1,54 +1,23 @@
#!/usr/bin/make -f
-
-PACKAGE=$(shell dh_listpackages)
-
-ifndef PERL
-PERL = /usr/bin/perl
-endif
-
-TMP =$(CURDIR)/debian/$(PACKAGE)
build: build-stamp
build-stamp:
- dh_testdir
- $(PERL) Makefile.PL INSTALLDIRS=vendor
- $(MAKE)
- touch build-stamp
+ dh build
+ touch $@
clean:
- dh_testdir
- dh_testroot
- -$(MAKE) distclean
- dh_clean build-stamp install-stamp
+ dh $@
install: install-stamp
install-stamp: build-stamp
- dh_testdir
- dh_testroot
- dh_clean -k
- $(MAKE) test
- $(MAKE) install DESTDIR=$(TMP) PREFIX=/usr
- [ ! -d $(TMP)/usr/lib/perl5 ] || rmdir --ignore-fail-on-non-empty --parents $(TMP)/usr/lib/perl5
- touch install-stamp
+ dh install
+ touch $@
binary-arch:
-# We have nothing to do by default.
-binary-indep: build install
- dh_testdir
- dh_testroot
- dh_installdocs
- dh_perl
- dh_installchangelogs Changes
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_gencontrol
- dh_md5sums
- dh_builddeb
+binary-indep: install
+ dh $@
-source diff:
- @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+binary: binary-arch binary-indep
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary
+.PHONY: binary binary-arch binary-indep install clean build
Modified: trunk/libtemplate-timer-perl/t/00-load.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtemplate-timer-perl/t/00-load.t?rev=31711&op=diff
==============================================================================
--- trunk/libtemplate-timer-perl/t/00-load.t (original)
+++ trunk/libtemplate-timer-perl/t/00-load.t Sun Mar 8 15:40:33 2009
@@ -1,7 +1,12 @@
+#!perl
+
+use strict;
+use warnings;
+
use Test::More tests => 1;
BEGIN {
-use_ok( 'Template::Timer' );
+ use_ok( 'Template::Timer' );
}
diag( "Testing Template::Timer $Template::Timer::VERSION" );
Modified: trunk/libtemplate-timer-perl/t/eval.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtemplate-timer-perl/t/eval.t?rev=31711&op=diff
==============================================================================
--- trunk/libtemplate-timer-perl/t/eval.t (original)
+++ trunk/libtemplate-timer-perl/t/eval.t Sun Mar 8 15:40:33 2009
@@ -3,7 +3,11 @@
use strict;
use warnings;
-use Test::More tests => 2;
+use Test::More tests => 3;
+
+BEGIN {
+ use_ok( 'Template' );
+}
BEGIN {
use_ok( 'Template::Timer' );
@@ -14,10 +18,10 @@
CONTEXT => Template::Timer->new
} );
-my $block = "[% thing = 'doohickey' %]";
+my $block = q{[% thing = 'doohickey' %]};
TODO: { # See RT # 13225
- local $TODO = "Problem identified but not fixed";
+ local $TODO = 'Problem identified but not fixed';
my $rc = $tt->process( \*DATA, { block => $block } );
ok( $rc, 'eval' );
}
Modified: trunk/libtemplate-timer-perl/t/pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtemplate-timer-perl/t/pod.t?rev=31711&op=diff
==============================================================================
--- trunk/libtemplate-timer-perl/t/pod.t (original)
+++ trunk/libtemplate-timer-perl/t/pod.t Sun Mar 8 15:40:33 2009
@@ -1,6 +1,9 @@
#!perl -T
+use strict;
+use warnings;
+
use Test::More;
-eval "use Test::Pod 1.14";
-plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
+eval 'use Test::Pod 1.14';
+plan skip_all => 'Test::Pod 1.14 required for testing POD' if $@;
all_pod_files_ok();
More information about the Pkg-perl-cvs-commits
mailing list