From 06f91c0c7128d837abeafe883f4ac817519514aa Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 25 Jan 2010 16:30:31 -0500 Subject: [PATCH 001/140] importing 0.04 --- Changes | 23 +++++++++++ MANIFEST | 9 +++++ META.yml | 13 +++++++ Makefile.PL | 18 +++++++++ README | 49 ++++++++++++++++++++++++ Timer.pm | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++ t/00-load.t | 7 ++++ t/eval.t | 27 +++++++++++++ t/pod.t | 6 +++ 9 files changed, 260 insertions(+) create mode 100644 Changes create mode 100644 MANIFEST create mode 100644 META.yml create mode 100644 Makefile.PL create mode 100644 README create mode 100644 Timer.pm create mode 100644 t/00-load.t create mode 100644 t/eval.t create mode 100644 t/pod.t diff --git a/Changes b/Changes new file mode 100644 index 0000000..97bb203 --- /dev/null +++ b/Changes @@ -0,0 +1,23 @@ +Revision history for Template::Timer + +0.04 Sun Oct 16 22:56:51 CDT 2005 + + [FIXES] + When calling + + [% 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. + + +0.02 Tue Oct 26 11:08:33 CDT 2004 + + * First actual working version. Fixed bonheaded typo. + + +0.01 Tue Oct 26 09:58:24 CDT 2004 + + * First rudimentary version. Patches and comments welcome. + diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..7f954d8 --- /dev/null +++ b/MANIFEST @@ -0,0 +1,9 @@ +Changes +MANIFEST +META.yml # Will be created by "make dist" +Makefile.PL +README +Timer.pm +t/00-load.t +t/eval.t +t/pod.t diff --git a/META.yml b/META.yml new file mode 100644 index 0000000..f86b1c6 --- /dev/null +++ b/META.yml @@ -0,0 +1,13 @@ +# 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: + Template: 0 + Test::More: 0 + Time::HiRes: 0 + +distribution_type: module +generated_by: ExtUtils::MakeMaker version 6.30 diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..5034826 --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,18 @@ +use strict; +use warnings; +use ExtUtils::MakeMaker; + +WriteMakefile( + NAME => 'Template::Timer', + AUTHOR => 'Andy Lester ', + VERSION_FROM => 'Timer.pm', + ABSTRACT_FROM => 'Timer.pm', + PL_FILES => {}, + PREREQ_PM => { + 'Template' => 0, + 'Test::More' => 0, + 'Time::HiRes' => 0, + }, + dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, + clean => { FILES => 'Template-Timer-*' }, +); diff --git a/README b/README new file mode 100644 index 0000000..d9d0ba0 --- /dev/null +++ b/README @@ -0,0 +1,49 @@ +Template::Timer provides inline timings of the template processing +througout your code. It's an overridden version of Template::Context +that wraps the process() and include() methods. + +Using Template::Timer is simple. + + my %config = ( # Whatever your config is + INCLUDE_PATH => "/my/template/path", + COMPILE_EXT => ".ttc", + COMPILE_DIR => "/tmp/tt", + ); + + if ( $development_mode ) { + $config{ CONTEXT } = Template::Timer->new( %config ); + } + + my $template = Template->new( \%config ); + +Now when you process templates, HTML comments will get embedded in your +output, which you can easily grep for. + + + + + + + +.... + + + + + +INSTALLATION + +To install this module, run the following commands: + + perl Makefile.PL + make + make test + make install + + +COPYRIGHT AND LICENCE + +Copyright (C) 2004 Andy Lester + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. diff --git a/Timer.pm b/Timer.pm new file mode 100644 index 0000000..bdc4c4f --- /dev/null +++ b/Timer.pm @@ -0,0 +1,108 @@ +package Template::Timer; + +use warnings; +use strict; + +=head1 NAME + +Template::Timer - Rudimentary profiling for Template Toolkit + +=head1 VERSION + +Version 0.04 + +=cut + +our $VERSION = '0.04'; + +=head1 SYNOPSIS + +Template::Timer provides inline timings of the template processing +througout your code. It's an overridden version of L +that wraps the C and C methods. + +Using Template::Timer is simple. + + my %config = ( # Whatever your config is + INCLUDE_PATH => "/my/template/path", + COMPILE_EXT => ".ttc", + COMPILE_DIR => "/tmp/tt", + ); + + if ( $development_mode ) { + $config{ CONTEXT } = Template::Timer->new( %config ); + } + + my $template = Template->new( \%config ); + +Now when you process templates, HTML comments will get embedded in your +output, which you can easily grep for. + + + + + + + + .... + + + + + +Note that since INCLUDE is a wrapper around PROCESS, calls to INCLUDEs +will be doubled up, and slightly longer than the PROCESS call. + +=cut + +use base qw( Template::Context ); +use Time::HiRes (); # Save as much space as we can + +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" + +$data + +END + }; # sub +} # for + + +=head1 AUTHOR + +Andy Lester, C<< >> + +=head1 BUGS + +Please report any bugs or feature requests to +C, or through the web interface at +L. I will be notified, and then you'll automatically +be notified of progress on your bug as I make changes. + +=head1 ACKNOWLEDGEMENTS + +Thanks to +Randal Schwartz, +Bill Moseley, +and to Gavin Estey for the original code. + +=head1 COPYRIGHT & LICENSE + +Copyright 2005 Andy Lester, All Rights Reserved. + +This program is free software; you can redistribute it and/or modify it +under the same terms as Perl itself. + +=cut + +1; # End of Template::Timer diff --git a/t/00-load.t b/t/00-load.t new file mode 100644 index 0000000..5ddd37e --- /dev/null +++ b/t/00-load.t @@ -0,0 +1,7 @@ +use Test::More tests => 1; + +BEGIN { +use_ok( 'Template::Timer' ); +} + +diag( "Testing Template::Timer $Template::Timer::VERSION" ); diff --git a/t/eval.t b/t/eval.t new file mode 100644 index 0000000..414927d --- /dev/null +++ b/t/eval.t @@ -0,0 +1,27 @@ +#!perl -Tw + +use strict; +use warnings; + +use Test::More tests => 2; + +BEGIN { + use_ok( 'Template::Timer' ); +} + +my $tt = + Template->new( { + CONTEXT => Template::Timer->new + } ); + +my $block = "[% thing = 'doohickey' %]"; + +TODO: { # See RT # 13225 + local $TODO = "Problem identified but not fixed"; + my $rc = $tt->process( \*DATA, { block => $block } ); + ok( $rc, 'eval' ); +} + +__DATA__ +[% block | eval %] +[% thing %] diff --git a/t/pod.t b/t/pod.t new file mode 100644 index 0000000..976d7cd --- /dev/null +++ b/t/pod.t @@ -0,0 +1,6 @@ +#!perl -T + +use Test::More; +eval "use Test::Pod 1.14"; +plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; +all_pod_files_ok(); From 60c015c546fbfcf11b5617a05a81dc4c5d224dad Mon Sep 17 00:00:00 2001 From: Andy Lester Date: Fri, 6 Mar 2009 23:05:56 -0600 Subject: [PATCH 002/140] importing 0.05_01 --- Changes | 27 +++++++++----- Makefile.PL | 20 +++++++++++ Timer.pm | 99 +++++++++++++++++++++++++++++++++++++--------------- perlcriticrc | 24 +++++++++++++ t/00-load.t | 7 +++- t/eval.t | 10 ++++-- t/pod.t | 7 ++-- 7 files changed, 151 insertions(+), 43 deletions(-) create mode 100644 perlcriticrc diff --git a/Changes b/Changes index 97bb203..5a4d98c 100644 --- a/Changes +++ b/Changes @@ -1,23 +1,34 @@ Revision history for Template::Timer +NEXT + + [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. diff --git a/Makefile.PL b/Makefile.PL index 5034826..80acc04 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -16,3 +16,23 @@ WriteMakefile( dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'Template-Timer-*' }, ); + + +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; +} diff --git a/Timer.pm b/Timer.pm index bdc4c4f..ab248d0 100644 --- a/Timer.pm +++ b/Timer.pm @@ -9,11 +9,11 @@ Template::Timer - Rudimentary profiling for Template Toolkit =head1 VERSION -Version 0.04 +Version 0.05_01 =cut -our $VERSION = '0.04'; +our $VERSION = '0.05_01'; =head1 SYNOPSIS @@ -24,9 +24,9 @@ that wraps the C and C methods. Using Template::Timer is simple. 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 +36,19 @@ Using Template::Timer is simple. 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. - - - - - + + + + + .... - - - + + + Note that since INCLUDE is a wrapper around PROCESS, calls to INCLUDEs will be doubled up, and slightly longer than the PROCESS call. @@ -56,28 +56,69 @@ will be doubled up, and slightly longer than the PROCESS call. =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" - -$data - -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", + '', + '', + ); + @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 Andy Lester, C<< >> @@ -98,7 +139,7 @@ and to Gavin Estey for the original code. =head1 COPYRIGHT & LICENSE -Copyright 2005 Andy Lester, All Rights Reserved. +Copyright 2005-2007 Andy Lester, All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/perlcriticrc b/perlcriticrc new file mode 100644 index 0000000..7214993 --- /dev/null +++ b/perlcriticrc @@ -0,0 +1,24 @@ +[-CodeLayout::ProhibitParensWithBuiltins] +[CodeLayout::ProhibitHardTabs] +allow_leading_tabs = 0 + +[-ControlStructures::ProhibitPostfixControls] + +[-Documentation::RequirePodAtEnd] +[-Documentation::RequirePodSections] + +[-ErrorHandling::RequireCarping] + +[-InputOutput::ProhibitInteractiveTest] +[-InputOutput::ProhibitBacktickOperators] + +[-Miscellanea::RequireRcsKeywords] + +[-Modules::RequireVersionVar] + +[-RegularExpressions::RequireExtendedFormatting] +[-RegularExpressions::RequireLineBoundaryMatching] + +[-ValuesAndExpressions::ProhibitEmptyQuotes] + +[-Variables::ProhibitPunctuationVars] diff --git a/t/00-load.t b/t/00-load.t index 5ddd37e..2376124 100644 --- a/t/00-load.t +++ b/t/00-load.t @@ -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" ); diff --git a/t/eval.t b/t/eval.t index 414927d..ee82468 100644 --- a/t/eval.t +++ b/t/eval.t @@ -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 @@ my $tt = 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' ); } diff --git a/t/pod.t b/t/pod.t index 976d7cd..bdb151c 100644 --- a/t/pod.t +++ b/t/pod.t @@ -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(); From f7319bc1078b96693091a16a4c586374612a07ef Mon Sep 17 00:00:00 2001 From: Andy Lester Date: Fri, 6 Mar 2009 23:16:07 -0600 Subject: [PATCH 003/140] updating the change log --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..21852f1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*~ +Makefile +Makefile.old +blib/ +pm_to_blib From ff225a31eef0f30231b469b7faa66700cea3f773 Mon Sep 17 00:00:00 2001 From: Andy Lester Date: Fri, 6 Mar 2009 23:16:14 -0600 Subject: [PATCH 004/140] updating the change log --- Changes | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/Changes b/Changes index 5a4d98c..7aadbb8 100644 --- a/Changes +++ b/Changes @@ -1,34 +1,33 @@ Revision history for Template::Timer NEXT +==================================== +[ENHANCEMENTS] +Measurements are now in milliseconds, not seconds. - [ENHANCEMENTS] - Measurements are now in milliseconds, not seconds. +Now shows nesting level in the notes. - Now shows nesting level in the notes. - - The times are all shown as a summary at the end, not throughout - the page. +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. From f65267a5b0a6bdc2142007d9f4f7f0ed90b24b7d Mon Sep 17 00:00:00 2001 From: Andy Lester Date: Fri, 6 Mar 2009 23:22:20 -0600 Subject: [PATCH 005/140] updated to GPLv3 or Artistic 2.0, explicilty --- README | 11 ++++++++--- Timer.pm | 9 ++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/README b/README index d9d0ba0..bea927c 100644 --- a/README +++ b/README @@ -41,9 +41,14 @@ To install this module, run the following commands: 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 diff --git a/Timer.pm b/Timer.pm index ab248d0..a2c9426 100644 --- a/Timer.pm +++ b/Timer.pm @@ -139,10 +139,13 @@ and to Gavin Estey for the original code. =head1 COPYRIGHT & LICENSE -Copyright 2005-2007 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 From d8261d8380bfdbf076ba7493c322df0e07881afa Mon Sep 17 00:00:00 2001 From: Andy Lester Date: Fri, 6 Mar 2009 23:34:17 -0600 Subject: [PATCH 006/140] Releasing 1.00 --- Changes | 6 +++++- Makefile.PL | 12 +++++++++++- Timer.pm | 6 ++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index 7aadbb8..aa7bd58 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,10 @@ Revision history for Template::Timer -NEXT +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. diff --git a/Makefile.PL b/Makefile.PL index 80acc04..4df8373 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -2,7 +2,7 @@ use strict; use warnings; use ExtUtils::MakeMaker; -WriteMakefile( +my %parms = ( NAME => 'Template::Timer', AUTHOR => 'Andy Lester ', VERSION_FROM => 'Timer.pm', @@ -17,6 +17,16 @@ WriteMakefile( clean => { FILES => 'Template-Timer-*' }, ); +if ( $ExtUtils::MakeMaker::VERSION ge '6.36' ) { + $parms{EXTRA_META} = < and C methods. Using Template::Timer is simple. + use Template::Timer; + my %config = ( # Whatever your config is INCLUDE_PATH => '/my/template/path', COMPILE_EXT => '.ttc', From 3ec6e4ca8bfe708a32b1fd57f758c0f4dc1e2716 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 25 Jan 2010 19:53:10 -0500 Subject: [PATCH 007/140] Template::Timer -> Template::ShowStartStop --- Changes | 36 +---------- MANIFEST | 6 +- Makefile.PL | 14 ++--- README | 87 ++++++++++++++------------ ShowStartStop.pm | 123 +++++++++++++++++++++++++++++++++++++ Timer.pm | 154 ----------------------------------------------- 6 files changed, 185 insertions(+), 235 deletions(-) create mode 100644 ShowStartStop.pm delete mode 100644 Timer.pm diff --git a/Changes b/Changes index aa7bd58..759c58b 100644 --- a/Changes +++ b/Changes @@ -1,37 +1,5 @@ -Revision history for Template::Timer +Revision history for Template::Locator -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 - - [% 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. - - -0.02 Tue Oct 26 11:08:33 CDT 2004 -==================================== -First actual working version. Fixed bonheaded typo. - - -0.01 Tue Oct 26 09:58:24 CDT 2004 +0.01 Jan 25 2010 ==================================== First rudimentary version. Patches and comments welcome. diff --git a/MANIFEST b/MANIFEST index 7f954d8..513fe1b 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,9 +1,9 @@ Changes -MANIFEST -META.yml # Will be created by "make dist" Makefile.PL +MANIFEST +META.yml # Will be created by "make dist" README -Timer.pm +ShowStartStop.pm t/00-load.t t/eval.t t/pod.t diff --git a/Makefile.PL b/Makefile.PL index 4df8373..c0a2903 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -3,10 +3,10 @@ use warnings; use ExtUtils::MakeMaker; my %parms = ( - NAME => 'Template::Timer', - AUTHOR => 'Andy Lester ', - VERSION_FROM => 'Timer.pm', - ABSTRACT_FROM => 'Timer.pm', + NAME => 'Template::ShowStartStop', + AUTHOR => 'Caleb Cushing ', + VERSION_FROM => 'ShowStartStop.pm', + ABSTRACT_FROM => 'ShowStartStop.pm', PL_FILES => {}, PREREQ_PM => { 'Template' => 0, @@ -14,14 +14,14 @@ my %parms = ( 'Time::HiRes' => 0, }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, - clean => { FILES => 'Template-Timer-*' }, + clean => { FILES => 'Template-ShowStartStop-*' }, ); if ( $ExtUtils::MakeMaker::VERSION ge '6.36' ) { $parms{EXTRA_META} = < "/my/template/path", - COMPILE_EXT => ".ttc", - COMPILE_DIR => "/tmp/tt", - ); +SYNOPSIS + Template::ShowStartStop provides inline timings of the template + processing througout your code. It's an overridden version of + Template::Context that wraps the "process()" and "include()" methods. - if ( $development_mode ) { - $config{ CONTEXT } = Template::Timer->new( %config ); - } + Using Template::ShowStartStop is simple. - my $template = Template->new( \%config ); + use Template::ShowStartStop; -Now when you process templates, HTML comments will get embedded in your -output, which you can easily grep for. + my %config = ( # Whatever your config is + INCLUDE_PATH => '/my/template/path', + COMPILE_EXT => '.ttc', + COMPILE_DIR => '/tmp/tt', + ); - - - - - + if ( $development_mode ) { + $config{ CONTEXT } = Template::ShowStartStop->new( %config ); + } -.... + my $template = Template->new( \%config ); - - - + Now when you process templates, HTML comments will get embedded in your + output, which you can easily grep for. The nesting level is also shown. -INSTALLATION + + + + + -To install this module, run the following commands: + .... - perl Makefile.PL - make - make test - make install + + + + Note that since INCLUDE is a wrapper around PROCESS, calls to INCLUDEs + will be doubled up, and slightly longer than the PROCESS call. -COPYRIGHT AND LICENSE +AUTHOR + Caleb Cushing, "" -Copyright (C) 2004-2009 Andy Lester +BUGS + Please report any bugs or feature requests to + "bug-template-showstartstop at rt.cpan.org", or through the web + interface at . I will be notified, and then you'll + automatically be notified of progress on your bug as I make changes. -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. +ACKNOWLEDGEMENTS + Thanks to Andy Lester, Randal Schwartz, Bill Moseley, and to Gavin Estey + for the original code. - * http://www.gnu.org/copyleft/gpl.html +COPYRIGHT & LICENSE + 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. + + * http://www.gnu.org/copyleft/gpl.html + + * http://www.opensource.org/licenses/artistic-license-2.0.php - * http://www.opensource.org/licenses/artistic-license-2.0.php diff --git a/ShowStartStop.pm b/ShowStartStop.pm new file mode 100644 index 0000000..543b30f --- /dev/null +++ b/ShowStartStop.pm @@ -0,0 +1,123 @@ +package Template::ShowStartStop; + +use warnings; +use strict; + +=head1 NAME + +Template::ShowStartStop - Display where template's start and stop + +=head1 VERSION + +Version 0.01 + +=cut + +our $VERSION = '0.01'; + +=head1 SYNOPSIS + +Template::ShowStartStop provides inline timings of the template processing +througout your code. It's an overridden version of L +that wraps the C and C methods. + +Using Template::ShowStartStop is simple. + + use Template::ShowStartStop; + + my %config = ( # Whatever your config is + INCLUDE_PATH => '/my/template/path', + COMPILE_EXT => '.ttc', + COMPILE_DIR => '/tmp/tt', + ); + + if ( $development_mode ) { + $config{ CONTEXT } = Template::ShowStartStop->new( %config ); + } + + my $template = Template->new( \%config ); + +Now when you process templates, HTML comments will get embedded in your +output, which you can easily grep for. The nesting level is also shown. + + + + + + + + .... + + + + + +Note that since INCLUDE is a wrapper around PROCESS, calls to INCLUDEs +will be doubled up, and slightly longer than the PROCESS call. + +=cut + +use base qw( Template::Context ); + +foreach my $sub ( qw( process include ) ) { + no strict; + + my $super = __PACKAGE__->can("SUPER::$sub") or die; + + *{$sub} = sub { + my $self = shift; + my $what = shift; + + my $template; + + if ( ref($what) eq 'ARRAY' ) { + $template = join( ' + ', @{$what} ); + } elsif ( ref($what) ) { + $template = $what->name; + } else { + $template = $what; + } + + my $processed_data = $super->($self, $what, @_); + + return << "END" + +$processed_data + +END + }; # sub +} # for + + +=head1 AUTHOR + +Caleb Cushing, C<< >> + +=head1 BUGS + +Please report any bugs or feature requests to +C, or through the web interface at +L. I will be notified, and then you'll automatically +be notified of progress on your bug as I make changes. + +=head1 ACKNOWLEDGEMENTS + +Thanks to +Andy Lester, +Randal Schwartz, +Bill Moseley, +and to Gavin Estey for the original code. + +=head1 COPYRIGHT & LICENSE + +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. + + * http://www.gnu.org/copyleft/gpl.html + + * http://www.opensource.org/licenses/artistic-license-2.0.php + +=cut + +1; # End of Template::ShowStartStop diff --git a/Timer.pm b/Timer.pm deleted file mode 100644 index c803055..0000000 --- a/Timer.pm +++ /dev/null @@ -1,154 +0,0 @@ -package Template::Timer; - -use warnings; -use strict; - -=head1 NAME - -Template::Timer - Rudimentary profiling for Template Toolkit - -=head1 VERSION - -Version 1.00 - -=cut - -our $VERSION = '1.00'; - -=head1 SYNOPSIS - -Template::Timer provides inline timings of the template processing -througout your code. It's an overridden version of L -that wraps the C and C methods. - -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', - ); - - if ( $development_mode ) { - $config{ CONTEXT } = Template::Timer->new( %config ); - } - - my $template = Template->new( \%config ); - -Now when you process templates, HTML comments will get embedded in your -output, which you can easily grep for. The nesting level is also shown. - - - - - - - - .... - - - - - -Note that since INCLUDE is a wrapper around PROCESS, calls to INCLUDEs -will be doubled up, and slightly longer than the PROCESS call. - -=cut - -use base qw( Template::Context ); -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 $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", - '', - '', - ); - @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 - -Andy Lester, C<< >> - -=head1 BUGS - -Please report any bugs or feature requests to -C, or through the web interface at -L. I will be notified, and then you'll automatically -be notified of progress on your bug as I make changes. - -=head1 ACKNOWLEDGEMENTS - -Thanks to -Randal Schwartz, -Bill Moseley, -and to Gavin Estey for the original code. - -=head1 COPYRIGHT & LICENSE - -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. - - * http://www.gnu.org/copyleft/gpl.html - - * http://www.opensource.org/licenses/artistic-license-2.0.php - -=cut - -1; # End of Template::Timer From 8921541d5c245bd21d33fbfffae924108e5f05a0 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 26 Jan 2010 00:51:53 -0500 Subject: [PATCH 008/140] stop redundant process subs from displaying --- ShowStartStop.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index 543b30f..249375e 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -80,11 +80,15 @@ foreach my $sub ( qw( process include ) ) { my $processed_data = $super->($self, $what, @_); - return << "END" - + unless ($sub eq "process") { + return <\n $processed_data - +\n END + } else { + return $processed_data; + } }; # sub } # for From 6d0293d43cc2b961054c30fb5c728d837065deb8 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 26 Jan 2010 01:09:07 -0500 Subject: [PATCH 009/140] remove code to show includes --- Changes | 4 ++++ README | 18 +++++------------- ShowStartStop.pm | 31 +++++++++---------------------- 3 files changed, 18 insertions(+), 35 deletions(-) diff --git a/Changes b/Changes index 759c58b..8e157f5 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ Revision history for Template::Locator +0.02 Jan 26 2010 +==================================== +Show process only comments to remove redunancy + 0.01 Jan 25 2010 ==================================== First rudimentary version. Patches and comments welcome. diff --git a/README b/README index 72a4470..927670d 100644 --- a/README +++ b/README @@ -5,9 +5,9 @@ VERSION Version 0.01 SYNOPSIS - Template::ShowStartStop provides inline timings of the template - processing througout your code. It's an overridden version of - Template::Context that wraps the "process()" and "include()" methods. + Template::ShowStartStop provides inline comments througout your code + where each template stops and starts. It's an overridden version of + Template::Context that wraps the "process()" method. Using Template::ShowStartStop is simple. @@ -28,20 +28,12 @@ SYNOPSIS Now when you process templates, HTML comments will get embedded in your output, which you can easily grep for. The nesting level is also shown. - - - - + .... - - - - - Note that since INCLUDE is a wrapper around PROCESS, calls to INCLUDEs - will be doubled up, and slightly longer than the PROCESS call. + AUTHOR Caleb Cushing, "" diff --git a/ShowStartStop.pm b/ShowStartStop.pm index 249375e..d5f5b94 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -17,9 +17,9 @@ our $VERSION = '0.01'; =head1 SYNOPSIS -Template::ShowStartStop provides inline timings of the template processing -througout your code. It's an overridden version of L -that wraps the C and C methods. +Template::ShowStartStop provides inline comments througout your code where +each template stops and starts. It's an overridden version of L +that wraps the C method. Using Template::ShowStartStop is simple. @@ -40,26 +40,18 @@ Using Template::ShowStartStop is simple. Now when you process templates, HTML comments will get embedded in your output, which you can easily grep for. The nesting level is also shown. - - - - + .... - - - - -Note that since INCLUDE is a wrapper around PROCESS, calls to INCLUDEs -will be doubled up, and slightly longer than the PROCESS call. + =cut use base qw( Template::Context ); -foreach my $sub ( qw( process include ) ) { +foreach my $sub ( qw( process ) ) { no strict; my $super = __PACKAGE__->can("SUPER::$sub") or die; @@ -80,15 +72,10 @@ foreach my $sub ( qw( process include ) ) { my $processed_data = $super->($self, $what, @_); - unless ($sub eq "process") { - return <\n -$processed_data -\n + return < +$processed_data END - } else { - return $processed_data; - } }; # sub } # for From eb24861ac43ffdd0c65873c84b7048cec748fbc7 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 26 Jan 2010 01:20:18 -0500 Subject: [PATCH 010/140] add mention of Template::Timer in credits --- README | 2 +- ShowStartStop.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index 927670d..053e334 100644 --- a/README +++ b/README @@ -46,7 +46,7 @@ BUGS ACKNOWLEDGEMENTS Thanks to Andy Lester, Randal Schwartz, Bill Moseley, and to Gavin Estey - for the original code. + for the original Template::Timer code that this is based on. COPYRIGHT & LICENSE This library is free software; you can redistribute it and/or modify it diff --git a/ShowStartStop.pm b/ShowStartStop.pm index d5f5b94..6bcc60e 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -97,7 +97,7 @@ Thanks to Andy Lester, Randal Schwartz, Bill Moseley, -and to Gavin Estey for the original code. +and to Gavin Estey for the original Template::Timer code that this is based on. =head1 COPYRIGHT & LICENSE From 02b11e3b9238477dd657ff990350e718f426d3ce Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 26 Jan 2010 01:28:30 -0500 Subject: [PATCH 011/140] fix tests up to not use Template::Timer --- t/00-load.t | 4 ++-- t/eval.t | 4 ++-- t/pod.t | 9 --------- 3 files changed, 4 insertions(+), 13 deletions(-) delete mode 100644 t/pod.t diff --git a/t/00-load.t b/t/00-load.t index 2376124..0b4198b 100644 --- a/t/00-load.t +++ b/t/00-load.t @@ -6,7 +6,7 @@ use warnings; use Test::More tests => 1; BEGIN { - use_ok( 'Template::Timer' ); + use_ok( 'Template::ShowStartStop' ); } -diag( "Testing Template::Timer $Template::Timer::VERSION" ); +diag( "Testing Template::ShowStartStop $Template::ShowStartStop::VERSION" ); diff --git a/t/eval.t b/t/eval.t index ee82468..f9e783c 100644 --- a/t/eval.t +++ b/t/eval.t @@ -10,12 +10,12 @@ BEGIN { } BEGIN { - use_ok( 'Template::Timer' ); + use_ok( 'Template::ShowStartStop' ); } my $tt = Template->new( { - CONTEXT => Template::Timer->new + CONTEXT => Template::ShowStartStop->new } ); my $block = q{[% thing = 'doohickey' %]}; diff --git a/t/pod.t b/t/pod.t deleted file mode 100644 index bdb151c..0000000 --- a/t/pod.t +++ /dev/null @@ -1,9 +0,0 @@ -#!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 $@; -all_pod_files_ok(); From 17878244c7442825c665176e36a2ae0a304f4b18 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 26 Jan 2010 01:30:46 -0500 Subject: [PATCH 012/140] release version 0.02 --- ShowStartStop.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index 6bcc60e..51c881d 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -9,11 +9,11 @@ Template::ShowStartStop - Display where template's start and stop =head1 VERSION -Version 0.01 +Version 0.02 =cut -our $VERSION = '0.01'; +our $VERSION = '0.02'; =head1 SYNOPSIS From 53a93a9762cc2d21c79b21f2aa22890d4b603187 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 15 Feb 2010 22:14:08 -0500 Subject: [PATCH 013/140] Clean up files for wrong comments --- Changes | 6 +++++- README | 2 +- ShowStartStop.pm | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index 8e157f5..e51f55e 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,8 @@ -Revision history for Template::Locator +Revision history for Template::ShowStartStop + +0.03 Feb 15 2010 +==================================== +Clean up files for wrong comments 0.02 Jan 26 2010 ==================================== diff --git a/README b/README index 053e334..e0e49fe 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME Template::ShowStartStop - Display where template's start and stop VERSION - Version 0.01 + Version 0.03 SYNOPSIS Template::ShowStartStop provides inline comments througout your code diff --git a/ShowStartStop.pm b/ShowStartStop.pm index 51c881d..d9f4d34 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -9,11 +9,11 @@ Template::ShowStartStop - Display where template's start and stop =head1 VERSION -Version 0.02 +Version 0.03 =cut -our $VERSION = '0.02'; +our $VERSION = '0.03'; =head1 SYNOPSIS From 1ae3ae5cd66609742684faa458b31daf4ab2c138 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 1 Mar 2010 05:58:11 -0500 Subject: [PATCH 014/140] change from heredoc. I think it's sloppy --- Changes | 4 ++++ README | 2 +- ShowStartStop.pm | 14 ++++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Changes b/Changes index e51f55e..5658872 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ Revision history for Template::ShowStartStop +0.04 Mar 1 2010 +==================================== +change from heredoc. I think it's sloppy + 0.03 Feb 15 2010 ==================================== Clean up files for wrong comments diff --git a/README b/README index e0e49fe..317b1a8 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME Template::ShowStartStop - Display where template's start and stop VERSION - Version 0.03 + Version 0.04 SYNOPSIS Template::ShowStartStop provides inline comments througout your code diff --git a/ShowStartStop.pm b/ShowStartStop.pm index d9f4d34..83e15a7 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -9,11 +9,11 @@ Template::ShowStartStop - Display where template's start and stop =head1 VERSION -Version 0.03 +Version 0.04 =cut -our $VERSION = '0.03'; +our $VERSION = '0.04'; =head1 SYNOPSIS @@ -72,10 +72,12 @@ foreach my $sub ( qw( process ) ) { my $processed_data = $super->($self, $what, @_); - return < -$processed_data -END + my $output + = "" + . "$processed_data" + ; + + return $output; }; # sub } # for From 69310b5a913f0e45ccf4de5cc5d5108bf3d19050 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 1 Mar 2010 06:06:35 -0500 Subject: [PATCH 015/140] attempt to fix new whitespace bug --- ShowStartStop.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index 83e15a7..f5e2375 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -73,8 +73,8 @@ foreach my $sub ( qw( process ) ) { my $processed_data = $super->($self, $what, @_); my $output - = "" - . "$processed_data" + = "\n" + . "$processed_data\n" ; return $output; From 47c8d72067bc2ca1140b83a5adf6687edc36b961 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 1 Mar 2010 06:14:46 -0500 Subject: [PATCH 016/140] add whitespace for readability --- ShowStartStop.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index f5e2375..4d8ebc7 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -74,7 +74,8 @@ foreach my $sub ( qw( process ) ) { my $output = "\n" - . "$processed_data\n" + . "$processed_data" + . "\n" ; return $output; From 2c7c17a516e7bf94f9718a8b09ed38c29154b7f0 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 1 Mar 2010 06:24:49 -0500 Subject: [PATCH 017/140] attempt to change the way variables are passed in --- ShowStartStop.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index 4d8ebc7..55d0c19 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -57,8 +57,7 @@ foreach my $sub ( qw( process ) ) { my $super = __PACKAGE__->can("SUPER::$sub") or die; *{$sub} = sub { - my $self = shift; - my $what = shift; + my ( $self, $what ) = @_; my $template; From 8b5fab401649719880321c9f42678108d6aa336b Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 1 Mar 2010 12:40:20 -0500 Subject: [PATCH 018/140] Revert "attempt to change the way variables are passed in" This reverts commit 2c7c17a516e7bf94f9718a8b09ed38c29154b7f0. breaks existing behavior --- ShowStartStop.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index 55d0c19..4d8ebc7 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -57,7 +57,8 @@ foreach my $sub ( qw( process ) ) { my $super = __PACKAGE__->can("SUPER::$sub") or die; *{$sub} = sub { - my ( $self, $what ) = @_; + my $self = shift; + my $what = shift; my $template; From e6e3645f349111c0f1ed44d63c0c90e9f71b8108 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 1 Mar 2010 19:15:57 -0500 Subject: [PATCH 019/140] cosmetic changes --- ShowStartStop.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index 4d8ebc7..d55dcd3 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -79,9 +79,8 @@ foreach my $sub ( qw( process ) ) { ; return $output; - }; # sub -} # for - + }; +} =head1 AUTHOR From b57e44b29a5cdf56eb5308a8bba97a9ab4785b89 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 2 Mar 2010 00:01:56 -0500 Subject: [PATCH 020/140] see if it works with strict throughout --- ShowStartStop.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index d55dcd3..6751779 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -52,7 +52,7 @@ output, which you can easily grep for. The nesting level is also shown. use base qw( Template::Context ); foreach my $sub ( qw( process ) ) { - no strict; +# no strict; my $super = __PACKAGE__->can("SUPER::$sub") or die; From 8611c6526a8d49342a8a49dd1b163d8f5074823f Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 2 Mar 2010 00:23:04 -0500 Subject: [PATCH 021/140] Revert "see if it works with strict throughout" This reverts commit b57e44b29a5cdf56eb5308a8bba97a9ab4785b89. no it doesn't just checking to see what that would break --- ShowStartStop.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index 6751779..d55dcd3 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -52,7 +52,7 @@ output, which you can easily grep for. The nesting level is also shown. use base qw( Template::Context ); foreach my $sub ( qw( process ) ) { -# no strict; + no strict; my $super = __PACKAGE__->can("SUPER::$sub") or die; From 61c8c00d9c7088ba3db3d734d9367566eabdc34c Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 2 Mar 2010 01:55:34 -0500 Subject: [PATCH 022/140] try parent instead of base --- ShowStartStop.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index d55dcd3..791253b 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -49,7 +49,7 @@ output, which you can easily grep for. The nesting level is also shown. =cut -use base qw( Template::Context ); +use parent qw( Template::Context ); foreach my $sub ( qw( process ) ) { no strict; From 339c60af484c40f5e84a7bd0d135181bdec91912 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 2 Mar 2010 02:07:03 -0500 Subject: [PATCH 023/140] add parent to deps --- Makefile.PL | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.PL b/Makefile.PL index c0a2903..2c21a9c 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -9,6 +9,7 @@ my %parms = ( ABSTRACT_FROM => 'ShowStartStop.pm', PL_FILES => {}, PREREQ_PM => { + 'parent' => 0, 'Template' => 0, 'Test::More' => 0, 'Time::HiRes' => 0, From 1bcf3a936ff7868a2eaa9f363f66ecffe515dba5 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 2 Mar 2010 23:37:27 -0500 Subject: [PATCH 024/140] turn off strict refs only --- ShowStartStop.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index 791253b..b182ab0 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -52,7 +52,7 @@ output, which you can easily grep for. The nesting level is also shown. use parent qw( Template::Context ); foreach my $sub ( qw( process ) ) { - no strict; + no strict 'refs'; my $super = __PACKAGE__->can("SUPER::$sub") or die; From dd32ba3385ff3cb1b637a91d3612a3782743a9e9 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 5 Mar 2010 06:50:33 -0500 Subject: [PATCH 025/140] add comments on an IRC conversation these should be removed once implemented --- ShowStartStop.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index b182ab0..f15c254 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -114,3 +114,20 @@ License 2.0. =cut 1; # End of Template::ShowStartStop + +__END__ +# notes from an IRC conversation on how to improve this module +[Tuesday 02 March 2010] [04:26:51 pm] xenoterracide: you can get rid +of foreach, since you only wrap one method, also drop my $super = ...;, remove +'no strict', change '*{$sub} = sub {' for 'my $wrappedSub = sub {', use 'my +$processed_data = $self->SUPER::process(...)', and at the end put { no strict +'refs'; *{'process'} = $wrappedSub; }. +[Tuesday 02 March 2010] [04:32:10 pm] tm604 would I still +need the foreach if I was still wrapping include? +[Tuesday 02 March 2010] [04:32:31 pm] xenoterracide: Not really, +because it's needless complexity for something that's just subclassing one or +two methods. +[Tuesday 02 March 2010] [04:32:49 pm] k +[Tuesday 02 March 2010] [04:35:08 pm] xenoterracide: Just put the +common code in a single sub, and have it call include or process as +appropriate. From b1ef927f5c0167f6294ff44ca326d4560a4c8083 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 24 Mar 2010 03:16:43 -0400 Subject: [PATCH 026/140] change bug reporting policy --- ShowStartStop.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index f15c254..706eda1 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -88,10 +88,9 @@ Caleb Cushing, C<< >> =head1 BUGS -Please report any bugs or feature requests to -C, or through the web interface at -L. I will be notified, and then you'll automatically -be notified of progress on your bug as I make changes. +Please report any bugs or feature requests on +L +as I'm not found of RT. =head1 ACKNOWLEDGEMENTS From 120aef4b92c167e6a5cb31cf8d97faacf05d5ab2 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Sun, 4 Apr 2010 18:04:10 -0400 Subject: [PATCH 027/140] switch if else to tabular ternary --- ShowStartStop.pm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index 706eda1..341ccf4 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -60,15 +60,12 @@ foreach my $sub ( qw( process ) ) { my $self = shift; my $what = shift; - my $template; - - if ( ref($what) eq 'ARRAY' ) { - $template = join( ' + ', @{$what} ); - } elsif ( ref($what) ) { - $template = $what->name; - } else { - $template = $what; - } + my $template + # conditional # set $template to + = ref($what) eq 'ARRAY' ? join( ' + ', @{$what} ) + : ref($what) ? $what->name + : $what + ; my $processed_data = $super->($self, $what, @_); From f84ade0313e508a698ae3d7cef40ebc1100f5b11 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Sun, 4 Apr 2010 21:26:27 -0400 Subject: [PATCH 028/140] move pod to below __END__ small compiler optimization and readability improvement --- ShowStartStop.pm | 69 +++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index 341ccf4..9109ef5 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -15,6 +15,39 @@ Version 0.04 our $VERSION = '0.04'; +use parent qw( Template::Context ); + +foreach my $sub ( qw( process ) ) { + no strict 'refs'; + + my $super = __PACKAGE__->can("SUPER::$sub") or die; + + *{$sub} = sub { + my $self = shift; + my $what = shift; + + my $template + # conditional # set $template to + = ref($what) eq 'ARRAY' ? join( ' + ', @{$what} ) + : ref($what) ? $what->name + : $what + ; + + my $processed_data = $super->($self, $what, @_); + + my $output + = "\n" + . "$processed_data" + . "\n" + ; + + return $output; + }; +} + +1; +__END__ + =head1 SYNOPSIS Template::ShowStartStop provides inline comments througout your code where @@ -47,38 +80,6 @@ output, which you can easily grep for. The nesting level is also shown. -=cut - -use parent qw( Template::Context ); - -foreach my $sub ( qw( process ) ) { - no strict 'refs'; - - my $super = __PACKAGE__->can("SUPER::$sub") or die; - - *{$sub} = sub { - my $self = shift; - my $what = shift; - - my $template - # conditional # set $template to - = ref($what) eq 'ARRAY' ? join( ' + ', @{$what} ) - : ref($what) ? $what->name - : $what - ; - - my $processed_data = $super->($self, $what, @_); - - my $output - = "\n" - . "$processed_data" - . "\n" - ; - - return $output; - }; -} - =head1 AUTHOR Caleb Cushing, C<< >> @@ -108,10 +109,6 @@ License 2.0. * http://www.opensource.org/licenses/artistic-license-2.0.php =cut - -1; # End of Template::ShowStartStop - -__END__ # notes from an IRC conversation on how to improve this module [Tuesday 02 March 2010] [04:26:51 pm] xenoterracide: you can get rid of foreach, since you only wrap one method, also drop my $super = ...;, remove From 2d35747999bd91bb0fbd6f1bc755fc17a6aae2f7 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Sun, 4 Apr 2010 21:28:21 -0400 Subject: [PATCH 029/140] correct spelling error --- ShowStartStop.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index 9109ef5..cc4ede2 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -88,7 +88,7 @@ Caleb Cushing, C<< >> Please report any bugs or feature requests on L -as I'm not found of RT. +as I'm not fond of RT. =head1 ACKNOWLEDGEMENTS From fa3dc2185a540a100fa476a04e09540721e6a7a2 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 26 Apr 2010 06:50:48 -0400 Subject: [PATCH 030/140] remove foreach --- ShowStartStop.pm | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/ShowStartStop.pm b/ShowStartStop.pm index cc4ede2..60cd1c9 100644 --- a/ShowStartStop.pm +++ b/ShowStartStop.pm @@ -17,33 +17,33 @@ our $VERSION = '0.04'; use parent qw( Template::Context ); -foreach my $sub ( qw( process ) ) { - no strict 'refs'; +my $sub = qw(process); - my $super = __PACKAGE__->can("SUPER::$sub") or die; +my $super = __PACKAGE__->can("SUPER::$sub") or die; - *{$sub} = sub { - my $self = shift; - my $what = shift; +my $wrapped = sub { + my $self = shift; + my $what = shift; - my $template - # conditional # set $template to - = ref($what) eq 'ARRAY' ? join( ' + ', @{$what} ) - : ref($what) ? $what->name - : $what - ; + my $template + # conditional # set $template to + = ref($what) eq 'ARRAY' ? join( ' + ', @{$what} ) + : ref($what) ? $what->name + : $what + ; - my $processed_data = $super->($self, $what, @_); + my $processed_data = $super->($self, $what, @_); - my $output - = "\n" - . "$processed_data" - . "\n" - ; + my $output + = "\n" + . "$processed_data" + . "\n" + ; - return $output; - }; -} + return $output; +}; + +{ no strict 'refs'; *{$sub} = $wrapped; } 1; __END__ From dcaa53bc5e98947613889f27d48d4403ab1787e4 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 26 Apr 2010 08:02:12 -0400 Subject: [PATCH 031/140] remove files as precursor to Dist::Zilla adoption --- MANIFEST | 9 -------- META.yml | 13 ------------ Makefile.PL | 49 ------------------------------------------- README | 59 ---------------------------------------------------- perlcriticrc | 24 --------------------- 5 files changed, 154 deletions(-) delete mode 100644 MANIFEST delete mode 100644 META.yml delete mode 100644 Makefile.PL delete mode 100644 README delete mode 100644 perlcriticrc diff --git a/MANIFEST b/MANIFEST deleted file mode 100644 index 513fe1b..0000000 --- a/MANIFEST +++ /dev/null @@ -1,9 +0,0 @@ -Changes -Makefile.PL -MANIFEST -META.yml # Will be created by "make dist" -README -ShowStartStop.pm -t/00-load.t -t/eval.t -t/pod.t diff --git a/META.yml b/META.yml deleted file mode 100644 index f86b1c6..0000000 --- a/META.yml +++ /dev/null @@ -1,13 +0,0 @@ -# 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: - Template: 0 - Test::More: 0 - Time::HiRes: 0 - -distribution_type: module -generated_by: ExtUtils::MakeMaker version 6.30 diff --git a/Makefile.PL b/Makefile.PL deleted file mode 100644 index 2c21a9c..0000000 --- a/Makefile.PL +++ /dev/null @@ -1,49 +0,0 @@ -use strict; -use warnings; -use ExtUtils::MakeMaker; - -my %parms = ( - NAME => 'Template::ShowStartStop', - AUTHOR => 'Caleb Cushing ', - VERSION_FROM => 'ShowStartStop.pm', - ABSTRACT_FROM => 'ShowStartStop.pm', - PL_FILES => {}, - PREREQ_PM => { - 'parent' => 0, - 'Template' => 0, - 'Test::More' => 0, - 'Time::HiRes' => 0, - }, - dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, - clean => { FILES => 'Template-ShowStartStop-*' }, -); - -if ( $ExtUtils::MakeMaker::VERSION ge '6.36' ) { - $parms{EXTRA_META} = < '/my/template/path', - COMPILE_EXT => '.ttc', - COMPILE_DIR => '/tmp/tt', - ); - - if ( $development_mode ) { - $config{ CONTEXT } = Template::ShowStartStop->new( %config ); - } - - my $template = Template->new( \%config ); - - Now when you process templates, HTML comments will get embedded in your - output, which you can easily grep for. The nesting level is also shown. - - - - - .... - - - -AUTHOR - Caleb Cushing, "" - -BUGS - Please report any bugs or feature requests to - "bug-template-showstartstop at rt.cpan.org", or through the web - interface at . I will be notified, and then you'll - automatically be notified of progress on your bug as I make changes. - -ACKNOWLEDGEMENTS - Thanks to Andy Lester, Randal Schwartz, Bill Moseley, and to Gavin Estey - for the original Template::Timer code that this is based on. - -COPYRIGHT & LICENSE - 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. - - * http://www.gnu.org/copyleft/gpl.html - - * http://www.opensource.org/licenses/artistic-license-2.0.php - diff --git a/perlcriticrc b/perlcriticrc deleted file mode 100644 index 7214993..0000000 --- a/perlcriticrc +++ /dev/null @@ -1,24 +0,0 @@ -[-CodeLayout::ProhibitParensWithBuiltins] -[CodeLayout::ProhibitHardTabs] -allow_leading_tabs = 0 - -[-ControlStructures::ProhibitPostfixControls] - -[-Documentation::RequirePodAtEnd] -[-Documentation::RequirePodSections] - -[-ErrorHandling::RequireCarping] - -[-InputOutput::ProhibitInteractiveTest] -[-InputOutput::ProhibitBacktickOperators] - -[-Miscellanea::RequireRcsKeywords] - -[-Modules::RequireVersionVar] - -[-RegularExpressions::RequireExtendedFormatting] -[-RegularExpressions::RequireLineBoundaryMatching] - -[-ValuesAndExpressions::ProhibitEmptyQuotes] - -[-Variables::ProhibitPunctuationVars] From ebf8deef21fb4d115b8db4dbf89786df320f4d4d Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 26 Apr 2010 08:08:00 -0400 Subject: [PATCH 032/140] relocate ShowStartStop.pm for Dist::Zilla --- ShowStartStop.pm => lib/Template/ShowStartStop.pm | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ShowStartStop.pm => lib/Template/ShowStartStop.pm (100%) diff --git a/ShowStartStop.pm b/lib/Template/ShowStartStop.pm similarity index 100% rename from ShowStartStop.pm rename to lib/Template/ShowStartStop.pm From 56d02c0f41d7d19c2d75d5f4ca0b527d7d6a79d8 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 26 Apr 2010 08:14:19 -0400 Subject: [PATCH 033/140] ignore output for Dist::Zilla --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 21852f1..0ce28bf 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ Makefile Makefile.old blib/ pm_to_blib +Template-ShowStartStop-* From bb8c6f6a6599e29681efa625c674a2fb06b7ad9f Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 26 Apr 2010 08:14:39 -0400 Subject: [PATCH 034/140] bump version number in T::SSS --- lib/Template/ShowStartStop.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index 60cd1c9..c299ea8 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -9,11 +9,11 @@ Template::ShowStartStop - Display where template's start and stop =head1 VERSION -Version 0.04 +Version 0.05 =cut -our $VERSION = '0.04'; +our $VERSION = '0.05'; use parent qw( Template::Context ); From ec7d2dc0555239eab1e3a50ad7460de916c536eb Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 26 Apr 2010 08:15:19 -0400 Subject: [PATCH 035/140] add initial dist.ini --- dist.ini | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 dist.ini diff --git a/dist.ini b/dist.ini new file mode 100644 index 0000000..8ce1154 --- /dev/null +++ b/dist.ini @@ -0,0 +1,9 @@ +name = Template-ShowStartStop +version = 0.05 +author = Caleb Cushing +license = Perl_5 +copyright_holder = Caleb Cushing + +[@Basic] + +[AutoPrereq] From 7a9ed84500276f96125fab56c6e44645d5cb0cde Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 26 Apr 2010 08:18:08 -0400 Subject: [PATCH 036/140] update Changes --- Changes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Changes b/Changes index 5658872..0f5d076 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,9 @@ Revision history for Template::ShowStartStop +0.05 Apr 26 2010 +==================================== +change back to ternary. +remove foreach. +use Dist::Zilla for packaging 0.04 Mar 1 2010 ==================================== From 7c517057ace9bbc1e719d60396163c76ac445a82 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 26 Apr 2010 10:09:48 -0400 Subject: [PATCH 037/140] add stuff for release --- dist.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dist.ini b/dist.ini index 8ce1154..cbb38a6 100644 --- a/dist.ini +++ b/dist.ini @@ -7,3 +7,7 @@ copyright_holder = Caleb Cushing [@Basic] [AutoPrereq] + +[TestRelease] +[ConfirmRelease] +[UploadToCPAN] From 256a0201d6406dd7fce5ea6c1e505998e9cd09aa Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 26 Apr 2010 16:42:15 -0400 Subject: [PATCH 038/140] make distzilla do more for me --- dist.ini | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dist.ini b/dist.ini index cbb38a6..1fa2629 100644 --- a/dist.ini +++ b/dist.ini @@ -1,5 +1,5 @@ name = Template-ShowStartStop -version = 0.05 +version = 0.06 author = Caleb Cushing license = Perl_5 copyright_holder = Caleb Cushing @@ -8,6 +8,15 @@ copyright_holder = Caleb Cushing [AutoPrereq] +[PkgVersion] +[PodVersion] + +[NextRelease] + [TestRelease] [ConfirmRelease] [UploadToCPAN] + +[@Git] +push_to = my +tag_format = %v From 7c2f79e9424a84adcc506d18368938e067751f49 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 26 Apr 2010 16:42:30 -0400 Subject: [PATCH 039/140] make dzil handle versioning --- lib/Template/ShowStartStop.pm | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index c299ea8..3beb4b4 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -7,14 +7,8 @@ use strict; Template::ShowStartStop - Display where template's start and stop -=head1 VERSION - -Version 0.05 - =cut -our $VERSION = '0.05'; - use parent qw( Template::Context ); my $sub = qw(process); From 08c4f26577b2f5aa51ed9053a53b3a49715d35a0 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 27 Apr 2010 21:21:51 -0400 Subject: [PATCH 040/140] move stuff around for dzil --- dist.ini | 21 +++++++++++++-------- Changes => src/Changes | 1 + {lib => src/lib}/Template/ShowStartStop.pm | 6 ++---- {t => src/t}/00-load.t | 0 {t => src/t}/eval.t | 0 5 files changed, 16 insertions(+), 12 deletions(-) rename Changes => src/Changes (98%) rename {lib => src/lib}/Template/ShowStartStop.pm (99%) rename {t => src/t}/00-load.t (100%) rename {t => src/t}/eval.t (100%) diff --git a/dist.ini b/dist.ini index 1fa2629..ae9ee1e 100644 --- a/dist.ini +++ b/dist.ini @@ -1,10 +1,15 @@ -name = Template-ShowStartStop -version = 0.06 -author = Caleb Cushing -license = Perl_5 +name = Template-ShowStartStop +abstract = Display where template's start and stop +version = 0.06 +author = Caleb Cushing +license = Perl_5 copyright_holder = Caleb Cushing -[@Basic] +[@Filter] +bundle = @Basic +remove = GatherDir +[GatherDir] +root = src [AutoPrereq] @@ -13,9 +18,9 @@ copyright_holder = Caleb Cushing [NextRelease] -[TestRelease] -[ConfirmRelease] -[UploadToCPAN] +[ExtraTests] +[PodSyntaxTests] +[PodCoverageTests] [@Git] push_to = my diff --git a/Changes b/src/Changes similarity index 98% rename from Changes rename to src/Changes index 0f5d076..d82865a 100644 --- a/Changes +++ b/src/Changes @@ -1,4 +1,5 @@ Revision history for Template::ShowStartStop +{{$NEXT}} 0.05 Apr 26 2010 ==================================== change back to ternary. diff --git a/lib/Template/ShowStartStop.pm b/src/lib/Template/ShowStartStop.pm similarity index 99% rename from lib/Template/ShowStartStop.pm rename to src/lib/Template/ShowStartStop.pm index 3beb4b4..751a3d8 100644 --- a/lib/Template/ShowStartStop.pm +++ b/src/lib/Template/ShowStartStop.pm @@ -1,14 +1,12 @@ package Template::ShowStartStop; - -use warnings; -use strict; - =head1 NAME Template::ShowStartStop - Display where template's start and stop =cut +use strict; +use warnings; use parent qw( Template::Context ); my $sub = qw(process); diff --git a/t/00-load.t b/src/t/00-load.t similarity index 100% rename from t/00-load.t rename to src/t/00-load.t diff --git a/t/eval.t b/src/t/eval.t similarity index 100% rename from t/eval.t rename to src/t/eval.t From 24be6237da1625a6c452c2950d2087a52eed858e Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 28 Apr 2010 00:00:55 -0400 Subject: [PATCH 041/140] use PodWeaver --- dist.ini | 2 +- src/lib/Template/ShowStartStop.pm | 23 ++--------------------- weaver.ini | 1 + 3 files changed, 4 insertions(+), 22 deletions(-) create mode 100644 weaver.ini diff --git a/dist.ini b/dist.ini index ae9ee1e..a0ea600 100644 --- a/dist.ini +++ b/dist.ini @@ -14,7 +14,7 @@ root = src [AutoPrereq] [PkgVersion] -[PodVersion] +[PodWeaver] [NextRelease] diff --git a/src/lib/Template/ShowStartStop.pm b/src/lib/Template/ShowStartStop.pm index 751a3d8..e633455 100644 --- a/src/lib/Template/ShowStartStop.pm +++ b/src/lib/Template/ShowStartStop.pm @@ -1,10 +1,4 @@ package Template::ShowStartStop; -=head1 NAME - -Template::ShowStartStop - Display where template's start and stop - -=cut - use strict; use warnings; use parent qw( Template::Context ); @@ -39,7 +33,7 @@ my $wrapped = sub { 1; __END__ - +# ABSTRACT: Display where template's start and stop =head1 SYNOPSIS Template::ShowStartStop provides inline comments througout your code where @@ -72,10 +66,6 @@ output, which you can easily grep for. The nesting level is also shown. -=head1 AUTHOR - -Caleb Cushing, C<< >> - =head1 BUGS Please report any bugs or feature requests on @@ -90,17 +80,8 @@ Randal Schwartz, Bill Moseley, and to Gavin Estey for the original Template::Timer code that this is based on. -=head1 COPYRIGHT & LICENSE - -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. - - * http://www.gnu.org/copyleft/gpl.html - - * http://www.opensource.org/licenses/artistic-license-2.0.php - =cut + # notes from an IRC conversation on how to improve this module [Tuesday 02 March 2010] [04:26:51 pm] xenoterracide: you can get rid of foreach, since you only wrap one method, also drop my $super = ...;, remove diff --git a/weaver.ini b/weaver.ini new file mode 100644 index 0000000..456039c --- /dev/null +++ b/weaver.ini @@ -0,0 +1 @@ +[@Default] From 04a7d3b372127eb0c1ff358c92038435946e1c76 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 28 Apr 2010 00:39:37 -0400 Subject: [PATCH 042/140] ignore dzil .build directory --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0ce28bf..9f50c38 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ Makefile.old blib/ pm_to_blib Template-ShowStartStop-* +.build From 5ee6669d5442367ec815d5a72943f4859e33f441 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 28 Apr 2010 00:40:00 -0400 Subject: [PATCH 043/140] Test Synopsis and make the test pass --- dist.ini | 1 + src/lib/Template/ShowStartStop.pm | 17 ++++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dist.ini b/dist.ini index a0ea600..cf17d3b 100644 --- a/dist.ini +++ b/dist.ini @@ -21,6 +21,7 @@ root = src [ExtraTests] [PodSyntaxTests] [PodCoverageTests] +[SynopsisTests] [@Git] push_to = my diff --git a/src/lib/Template/ShowStartStop.pm b/src/lib/Template/ShowStartStop.pm index e633455..1b27c9d 100644 --- a/src/lib/Template/ShowStartStop.pm +++ b/src/lib/Template/ShowStartStop.pm @@ -36,12 +36,6 @@ __END__ # ABSTRACT: Display where template's start and stop =head1 SYNOPSIS -Template::ShowStartStop provides inline comments througout your code where -each template stops and starts. It's an overridden version of L -that wraps the C method. - -Using Template::ShowStartStop is simple. - use Template::ShowStartStop; my %config = ( # Whatever your config is @@ -50,12 +44,17 @@ Using Template::ShowStartStop is simple. COMPILE_DIR => '/tmp/tt', ); - if ( $development_mode ) { - $config{ CONTEXT } = Template::ShowStartStop->new( %config ); - } + $config{ CONTEXT } = Template::ShowStartStop->new( %config ); my $template = Template->new( \%config ); +=head1 DESCRIPTION + +Template::ShowStartStop provides inline comments througout your code where +each template stops and starts. It's an overridden version of L +that wraps the C method. + +Using Template::ShowStartStop is simple. Now when you process templates, HTML comments will get embedded in your output, which you can easily grep for. The nesting level is also shown. From a99bb06df3fe1bc7534385c6225461468726e8bb Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 28 Apr 2010 01:04:38 -0400 Subject: [PATCH 044/140] have dzil add the source repo to meta --- dist.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/dist.ini b/dist.ini index cf17d3b..af77fd1 100644 --- a/dist.ini +++ b/dist.ini @@ -15,6 +15,7 @@ root = src [PkgVersion] [PodWeaver] +[Repository] [NextRelease] From a695870d8517c340b9a8742eb78fb32f59041f8a Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 28 Apr 2010 01:05:06 -0400 Subject: [PATCH 045/140] have dzil add test for dep versions --- dist.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/dist.ini b/dist.ini index af77fd1..c529542 100644 --- a/dist.ini +++ b/dist.ini @@ -23,6 +23,7 @@ root = src [PodSyntaxTests] [PodCoverageTests] [SynopsisTests] +[ReportVersions] [@Git] push_to = my From f34e05baa03f96c95434066d619db91ffa00d2eb Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 28 Apr 2010 02:02:57 -0400 Subject: [PATCH 046/140] copy dzil output to current directory this is so we can still install from git. --- dist.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dist.ini b/dist.ini index c529542..7c09126 100644 --- a/dist.ini +++ b/dist.ini @@ -25,6 +25,9 @@ root = src [SynopsisTests] [ReportVersions] +[CopyTo] + dir = . + [@Git] push_to = my tag_format = %v From 46c1d7afe2b20122d5fab1468d0428ff8425d580 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 28 Apr 2010 02:03:34 -0400 Subject: [PATCH 047/140] import all dzil output --- Changes | 23 ++ LICENSE | 377 +++++++++++++++++++++++++++++ MANIFEST | 13 + META.yml | 24 ++ Makefile.PL | 57 +++++ README | 13 + lib/Template/ShowStartStop.pm | 126 ++++++++++ t/00-load.t | 12 + t/000-report-versions.t | 442 ++++++++++++++++++++++++++++++++++ t/eval.t | 31 +++ t/release-pod-coverage.t | 21 ++ t/release-pod-syntax.t | 15 ++ t/release-synopsis.t | 16 ++ 13 files changed, 1170 insertions(+) create mode 100644 Changes create mode 100644 LICENSE create mode 100644 MANIFEST create mode 100644 META.yml create mode 100644 Makefile.PL create mode 100644 README create mode 100644 lib/Template/ShowStartStop.pm create mode 100644 t/00-load.t create mode 100644 t/000-report-versions.t create mode 100644 t/eval.t create mode 100644 t/release-pod-coverage.t create mode 100644 t/release-pod-syntax.t create mode 100644 t/release-synopsis.t diff --git a/Changes b/Changes new file mode 100644 index 0000000..7bd32c1 --- /dev/null +++ b/Changes @@ -0,0 +1,23 @@ +Revision history for Template::ShowStartStop +0.06 2010-04-28 01:41:46 America/Detroit +0.05 Apr 26 2010 +==================================== +change back to ternary. +remove foreach. +use Dist::Zilla for packaging + +0.04 Mar 1 2010 +==================================== +change from heredoc. I think it's sloppy + +0.03 Feb 15 2010 +==================================== +Clean up files for wrong comments + +0.02 Jan 26 2010 +==================================== +Show process only comments to remove redunancy + +0.01 Jan 25 2010 +==================================== +First rudimentary version. Patches and comments welcome. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9f49929 --- /dev/null +++ b/LICENSE @@ -0,0 +1,377 @@ +This software is copyright (c) 2010 by Caleb Cushing. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +Terms of the Perl programming language system itself + +a) the GNU General Public License as published by the Free + Software Foundation; either version 1, or (at your option) any + later version, or +b) the "Artistic License" + +--- The GNU General Public License, Version 1, February 1989 --- + +This software is Copyright (c) 2010 by Caleb Cushing. + +This is free software, licensed under: + + The GNU General Public License, Version 1, February 1989 + + GNU GENERAL PUBLIC LICENSE + Version 1, February 1989 + + Copyright (C) 1989 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The license agreements of most software companies try to keep users +at the mercy of those companies. By contrast, our General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. The +General Public License applies to the Free Software Foundation's +software and to any other program whose authors commit to using it. +You can use it for your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Specifically, the General Public License is designed to make +sure that you have the freedom to give away or sell copies of free +software, that you receive source code or can get it if you want it, +that you can change the software or use pieces of it in new free +programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of a such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must tell them their rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any program or other work which +contains a notice placed by the copyright holder saying it may be +distributed under the terms of this General Public License. The +"Program", below, refers to any such program or work, and a "work based +on the Program" means either the Program or any work containing the +Program or a portion of it, either verbatim or with modifications. Each +licensee is addressed as "you". + + 1. You may copy and distribute verbatim copies of the Program's source +code as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this +General Public License and to the absence of any warranty; and give any +other recipients of the Program a copy of this General Public License +along with the Program. You may charge a fee for the physical act of +transferring a copy. + + 2. You may modify your copy or copies of the Program or any portion of +it, and copy and distribute such modifications under the terms of Paragraph +1 above, provided that you also do the following: + + a) cause the modified files to carry prominent notices stating that + you changed the files and the date of any change; and + + b) cause the whole of any work that you distribute or publish, that + in whole or in part contains the Program or any part thereof, either + with or without modifications, to be licensed at no charge to all + third parties under the terms of this General Public License (except + that you may choose to grant warranty protection to some or all + third parties, at your option). + + c) If the modified program normally reads commands interactively when + run, you must cause it, when started running for such interactive use + in the simplest and most usual way, to print or display an + announcement including an appropriate copyright notice and a notice + that there is no warranty (or else, saying that you provide a + warranty) and that users may redistribute the program under these + conditions, and telling the user how to view a copy of this General + Public License. + + d) You may charge a fee for the physical act of transferring a + copy, and you may at your option offer warranty protection in + exchange for a fee. + +Mere aggregation of another independent work with the Program (or its +derivative) on a volume of a storage or distribution medium does not bring +the other work under the scope of these terms. + + 3. You may copy and distribute the Program (or a portion or derivative of +it, under Paragraph 2) in object code or executable form under the terms of +Paragraphs 1 and 2 above provided that you also do one of the following: + + a) accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of + Paragraphs 1 and 2 above; or, + + b) accompany it with a written offer, valid for at least three + years, to give any third party free (except for a nominal charge + for the cost of distribution) a complete machine-readable copy of the + corresponding source code, to be distributed under the terms of + Paragraphs 1 and 2 above; or, + + c) accompany it with the information you received as to where the + corresponding source code may be obtained. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form alone.) + +Source code for a work means the preferred form of the work for making +modifications to it. For an executable file, complete source code means +all the source code for all modules it contains; but, as a special +exception, it need not include source code for modules which are standard +libraries that accompany the operating system on which the executable +file runs, or for standard header files or definitions files that +accompany that operating system. + + 4. You may not copy, modify, sublicense, distribute or transfer the +Program except as expressly provided under this General Public License. +Any attempt otherwise to copy, modify, sublicense, distribute or transfer +the Program is void, and will automatically terminate your rights to use +the Program under this License. However, parties who have received +copies, or rights to use copies, from you under this General Public +License will not have their licenses terminated so long as such parties +remain in full compliance. + + 5. By copying, distributing or modifying the Program (or any work based +on the Program) you indicate your acceptance of this license to do so, +and all its terms and conditions. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the original +licensor to copy, distribute or modify the Program subject to these +terms and conditions. You may not impose any further restrictions on the +recipients' exercise of the rights granted herein. + + 7. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of the license which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +the license, you may choose any version ever published by the Free Software +Foundation. + + 8. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to humanity, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively convey +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 1, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19xx name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, the +commands you use may be called something other than `show w' and `show +c'; they could even be mouse-clicks or menu items--whatever suits your +program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + program `Gnomovision' (a program to direct compilers to make passes + at assemblers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +That's all there is to it! + + +--- The Artistic License 1.0 --- + +This software is Copyright (c) 2010 by Caleb Cushing. + +This is free software, licensed under: + + The Artistic License 1.0 + +The Artistic License + +Preamble + +The intent of this document is to state the conditions under which a Package +may be copied, such that the Copyright Holder maintains some semblance of +artistic control over the development of the package, while giving the users of +the package the right to use and distribute the Package in a more-or-less +customary fashion, plus the right to make reasonable modifications. + +Definitions: + + - "Package" refers to the collection of files distributed by the Copyright + Holder, and derivatives of that collection of files created through + textual modification. + - "Standard Version" refers to such a Package if it has not been modified, + or has been modified in accordance with the wishes of the Copyright + Holder. + - "Copyright Holder" is whoever is named in the copyright or copyrights for + the package. + - "You" is you, if you're thinking about copying or distributing this Package. + - "Reasonable copying fee" is whatever you can justify on the basis of media + cost, duplication charges, time of people involved, and so on. (You will + not be required to justify it to the Copyright Holder, but only to the + computing community at large as a market that must bear the fee.) + - "Freely Available" means that no fee is charged for the item itself, though + there may be fees involved in handling the item. It also means that + recipients of the item may redistribute it under the same conditions they + received it. + +1. You may make and give away verbatim copies of the source form of the +Standard Version of this Package without restriction, provided that you +duplicate all of the original copyright notices and associated disclaimers. + +2. You may apply bug fixes, portability fixes and other modifications derived +from the Public Domain or from the Copyright Holder. A Package modified in such +a way shall still be considered the Standard Version. + +3. You may otherwise modify your copy of this Package in any way, provided that +you insert a prominent notice in each changed file stating how and when you +changed that file, and provided that you do at least ONE of the following: + + a) place your modifications in the Public Domain or otherwise make them + Freely Available, such as by posting said modifications to Usenet or an + equivalent medium, or placing the modifications on a major archive site + such as ftp.uu.net, or by allowing the Copyright Holder to include your + modifications in the Standard Version of the Package. + + b) use the modified Package only within your corporation or organization. + + c) rename any non-standard executables so the names do not conflict with + standard executables, which must also be provided, and provide a separate + manual page for each non-standard executable that clearly documents how it + differs from the Standard Version. + + d) make other distribution arrangements with the Copyright Holder. + +4. You may distribute the programs of this Package in object code or executable +form, provided that you do at least ONE of the following: + + a) distribute a Standard Version of the executables and library files, + together with instructions (in the manual page or equivalent) on where to + get the Standard Version. + + b) accompany the distribution with the machine-readable source of the Package + with your modifications. + + c) accompany any non-standard executables with their corresponding Standard + Version executables, giving the non-standard executables non-standard + names, and clearly documenting the differences in manual pages (or + equivalent), together with instructions on where to get the Standard + Version. + + d) make other distribution arrangements with the Copyright Holder. + +5. You may charge a reasonable copying fee for any distribution of this +Package. You may charge any fee you choose for support of this Package. You +may not charge a fee for this Package itself. However, you may distribute this +Package in aggregate with other (possibly commercial) programs as part of a +larger (possibly commercial) software distribution provided that you do not +advertise this Package as a product of your own. + +6. The scripts and library files supplied as input to or produced as output +from the programs of this Package do not automatically fall under the copyright +of this Package, but belong to whomever generated them, and may be sold +commercially, and may be aggregated with this Package. + +7. C or perl subroutines supplied by you and linked into this Package shall not +be considered part of this Package. + +8. The name of the Copyright Holder may not be used to endorse or promote +products derived from this software without specific prior written permission. + +9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +The End + diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..7c31800 --- /dev/null +++ b/MANIFEST @@ -0,0 +1,13 @@ +Changes +LICENSE +MANIFEST +META.yml +Makefile.PL +README +lib/Template/ShowStartStop.pm +t/00-load.t +t/000-report-versions.t +t/eval.t +t/release-pod-coverage.t +t/release-pod-syntax.t +t/release-synopsis.t \ No newline at end of file diff --git a/META.yml b/META.yml new file mode 100644 index 0000000..baf5a02 --- /dev/null +++ b/META.yml @@ -0,0 +1,24 @@ +--- +abstract: "Display where template's start and stop" +author: + - 'Caleb Cushing ' +build_requires: + Carp: 0 + Scalar::Util: 0 + Test::More: 0.88 + perl: 5.004 +configure_requires: + ExtUtils::MakeMaker: 6.31 +generated_by: 'Dist::Zilla version 2.101160' +license: perl +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 +name: Template-ShowStartStop +recommends: {} +requires: + Template::Context: 0 + parent: 0 +resources: + repository: http://github.com/xenoterracide/Template-ShowStartStop +version: 0.06 diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..70e2eee --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,57 @@ + +use strict; +use warnings; + + + +use ExtUtils::MakeMaker 6.31; + + + +my %WriteMakefileArgs = ( + 'test' => { + 'TESTS' => 't/*.t' + }, + 'NAME' => 'Template::ShowStartStop', + 'DISTNAME' => 'Template-ShowStartStop', + 'CONFIGURE_REQUIRES' => { + 'ExtUtils::MakeMaker' => '6.31' + }, + 'AUTHOR' => 'Caleb Cushing ', + 'BUILD_REQUIRES' => { + 'Test::More' => '0.88', + 'Scalar::Util' => '0', + 'perl' => '5.004', + 'Carp' => '0' + }, + 'ABSTRACT' => 'Display where template\'s start and stop', + 'EXE_FILES' => [], + 'VERSION' => '0.06', + 'PREREQ_PM' => { + 'parent' => '0', + 'Template::Context' => '0' + }, + 'LICENSE' => 'perl' + ); + + +unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { + my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; + my $pp = $WriteMakefileArgs{PREREQ_PM}; + for my $mod ( keys %$br ) { + if ( exists $pp->{$mod} ) { + $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; + } + else { + $pp->{$mod} = $br->{$mod}; + } + } +} + +delete $WriteMakefileArgs{CONFIGURE_REQUIRES} + unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; + +WriteMakefile(%WriteMakefileArgs); + + + diff --git a/README b/README new file mode 100644 index 0000000..41ca54a --- /dev/null +++ b/README @@ -0,0 +1,13 @@ + + +This archive contains the distribution Template-ShowStartStop, +version 0.06: + + Display where template's start and stop + +This software is copyright (c) 2010 by Caleb Cushing. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + + diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm new file mode 100644 index 0000000..f36be9f --- /dev/null +++ b/lib/Template/ShowStartStop.pm @@ -0,0 +1,126 @@ +package Template::ShowStartStop; +BEGIN { + $Template::ShowStartStop::VERSION = '0.06'; +} +use strict; +use warnings; +use parent qw( Template::Context ); + +my $sub = qw(process); + +my $super = __PACKAGE__->can("SUPER::$sub") or die; + +my $wrapped = sub { + my $self = shift; + my $what = shift; + + my $template + # conditional # set $template to + = ref($what) eq 'ARRAY' ? join( ' + ', @{$what} ) + : ref($what) ? $what->name + : $what + ; + + my $processed_data = $super->($self, $what, @_); + + my $output + = "\n" + . "$processed_data" + . "\n" + ; + + return $output; +}; + +{ no strict 'refs'; *{$sub} = $wrapped; } + +1; + + +=pod + +=head1 NAME + +Template::ShowStartStop - Display where template's start and stop + +=head1 VERSION + +version 0.06 + +=head1 SYNOPSIS + + use Template::ShowStartStop; + + my %config = ( # Whatever your config is + INCLUDE_PATH => '/my/template/path', + COMPILE_EXT => '.ttc', + COMPILE_DIR => '/tmp/tt', + ); + + $config{ CONTEXT } = Template::ShowStartStop->new( %config ); + + my $template = Template->new( \%config ); + +=head1 DESCRIPTION + +Template::ShowStartStop provides inline comments througout your code where +each template stops and starts. It's an overridden version of L +that wraps the C method. + +Using Template::ShowStartStop is simple. +Now when you process templates, HTML comments will get embedded in your +output, which you can easily grep for. The nesting level is also shown. + + + + + .... + + + +=head1 BUGS + +Please report any bugs or feature requests on +L +as I'm not fond of RT. + +=head1 ACKNOWLEDGEMENTS + +Thanks to +Andy Lester, +Randal Schwartz, +Bill Moseley, +and to Gavin Estey for the original Template::Timer code that this is based on. + +=head1 AUTHOR + + Caleb Cushing + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2010 by Caleb Cushing. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut + + +__END__ +# ABSTRACT: Display where template's start and stop + +# notes from an IRC conversation on how to improve this module +[Tuesday 02 March 2010] [04:26:51 pm] xenoterracide: you can get rid +of foreach, since you only wrap one method, also drop my $super = ...;, remove +'no strict', change '*{$sub} = sub {' for 'my $wrappedSub = sub {', use 'my +$processed_data = $self->SUPER::process(...)', and at the end put { no strict +'refs'; *{'process'} = $wrappedSub; }. +[Tuesday 02 March 2010] [04:32:10 pm] tm604 would I still +need the foreach if I was still wrapping include? +[Tuesday 02 March 2010] [04:32:31 pm] xenoterracide: Not really, +because it's needless complexity for something that's just subclassing one or +two methods. +[Tuesday 02 March 2010] [04:32:49 pm] k +[Tuesday 02 March 2010] [04:35:08 pm] xenoterracide: Just put the +common code in a single sub, and have it call include or process as +appropriate. diff --git a/t/00-load.t b/t/00-load.t new file mode 100644 index 0000000..0b4198b --- /dev/null +++ b/t/00-load.t @@ -0,0 +1,12 @@ +#!perl + +use strict; +use warnings; + +use Test::More tests => 1; + +BEGIN { + use_ok( 'Template::ShowStartStop' ); +} + +diag( "Testing Template::ShowStartStop $Template::ShowStartStop::VERSION" ); diff --git a/t/000-report-versions.t b/t/000-report-versions.t new file mode 100644 index 0000000..9bd7a00 --- /dev/null +++ b/t/000-report-versions.t @@ -0,0 +1,442 @@ +#!perl +use warnings; +use strict; +use Test::More 0.88; + +# Include a cut-down version of YAML::Tiny so we don't introduce unnecessary +# dependencies ourselves. + +package Local::YAML::Tiny; + +use strict; +use Carp 'croak'; + +# UTF Support? +sub HAVE_UTF8 () { $] >= 5.007003 } +BEGIN { + if ( HAVE_UTF8 ) { + # The string eval helps hide this from Test::MinimumVersion + eval "require utf8;"; + die "Failed to load UTF-8 support" if $@; + } + + # Class structure + require 5.004; + $YAML::Tiny::VERSION = '1.40'; + + # Error storage + $YAML::Tiny::errstr = ''; +} + +# Printable characters for escapes +my %UNESCAPES = ( + z => "\x00", a => "\x07", t => "\x09", + n => "\x0a", v => "\x0b", f => "\x0c", + r => "\x0d", e => "\x1b", '\\' => '\\', +); + + +##################################################################### +# Implementation + +# Create an empty YAML::Tiny object +sub new { + my $class = shift; + bless [ @_ ], $class; +} + +# Create an object from a file +sub read { + my $class = ref $_[0] ? ref shift : shift; + + # Check the file + my $file = shift or return $class->_error( 'You did not specify a file name' ); + return $class->_error( "File '$file' does not exist" ) unless -e $file; + return $class->_error( "'$file' is a directory, not a file" ) unless -f _; + return $class->_error( "Insufficient permissions to read '$file'" ) unless -r _; + + # Slurp in the file + local $/ = undef; + local *CFG; + unless ( open(CFG, $file) ) { + return $class->_error("Failed to open file '$file': $!"); + } + my $contents = ; + unless ( close(CFG) ) { + return $class->_error("Failed to close file '$file': $!"); + } + + $class->read_string( $contents ); +} + +# Create an object from a string +sub read_string { + my $class = ref $_[0] ? ref shift : shift; + my $self = bless [], $class; + my $string = $_[0]; + unless ( defined $string ) { + return $self->_error("Did not provide a string to load"); + } + + # Byte order marks + # NOTE: Keeping this here to educate maintainers + # my %BOM = ( + # "\357\273\277" => 'UTF-8', + # "\376\377" => 'UTF-16BE', + # "\377\376" => 'UTF-16LE', + # "\377\376\0\0" => 'UTF-32LE' + # "\0\0\376\377" => 'UTF-32BE', + # ); + if ( $string =~ /^(?:\376\377|\377\376|\377\376\0\0|\0\0\376\377)/ ) { + return $self->_error("Stream has a non UTF-8 BOM"); + } else { + # Strip UTF-8 bom if found, we'll just ignore it + $string =~ s/^\357\273\277//; + } + + # Try to decode as utf8 + utf8::decode($string) if HAVE_UTF8; + + # Check for some special cases + return $self unless length $string; + unless ( $string =~ /[\012\015]+\z/ ) { + return $self->_error("Stream does not end with newline character"); + } + + # Split the file into lines + my @lines = grep { ! /^\s*(?:\#.*)?\z/ } + split /(?:\015{1,2}\012|\015|\012)/, $string; + + # Strip the initial YAML header + @lines and $lines[0] =~ /^\%YAML[: ][\d\.]+.*\z/ and shift @lines; + + # A nibbling parser + while ( @lines ) { + # Do we have a document header? + if ( $lines[0] =~ /^---\s*(?:(.+)\s*)?\z/ ) { + # Handle scalar documents + shift @lines; + if ( defined $1 and $1 !~ /^(?:\#.+|\%YAML[: ][\d\.]+)\z/ ) { + push @$self, $self->_read_scalar( "$1", [ undef ], \@lines ); + next; + } + } + + if ( ! @lines or $lines[0] =~ /^(?:---|\.\.\.)/ ) { + # A naked document + push @$self, undef; + while ( @lines and $lines[0] !~ /^---/ ) { + shift @lines; + } + + } elsif ( $lines[0] =~ /^\s*\-/ ) { + # An array at the root + my $document = [ ]; + push @$self, $document; + $self->_read_array( $document, [ 0 ], \@lines ); + + } elsif ( $lines[0] =~ /^(\s*)\S/ ) { + # A hash at the root + my $document = { }; + push @$self, $document; + $self->_read_hash( $document, [ length($1) ], \@lines ); + + } else { + croak("YAML::Tiny failed to classify the line '$lines[0]'"); + } + } + + $self; +} + +# Deparse a scalar string to the actual scalar +sub _read_scalar { + my ($self, $string, $indent, $lines) = @_; + + # Trim trailing whitespace + $string =~ s/\s*\z//; + + # Explitic null/undef + return undef if $string eq '~'; + + # Quotes + if ( $string =~ /^\'(.*?)\'\z/ ) { + return '' unless defined $1; + $string = $1; + $string =~ s/\'\'/\'/g; + return $string; + } + if ( $string =~ /^\"((?:\\.|[^\"])*)\"\z/ ) { + # Reusing the variable is a little ugly, + # but avoids a new variable and a string copy. + $string = $1; + $string =~ s/\\"/"/g; + $string =~ s/\\([never\\fartz]|x([0-9a-fA-F]{2}))/(length($1)>1)?pack("H2",$2):$UNESCAPES{$1}/gex; + return $string; + } + + # Special cases + if ( $string =~ /^[\'\"!&]/ ) { + croak("YAML::Tiny does not support a feature in line '$lines->[0]'"); + } + return {} if $string eq '{}'; + return [] if $string eq '[]'; + + # Regular unquoted string + return $string unless $string =~ /^[>|]/; + + # Error + croak("YAML::Tiny failed to find multi-line scalar content") unless @$lines; + + # Check the indent depth + $lines->[0] =~ /^(\s*)/; + $indent->[-1] = length("$1"); + if ( defined $indent->[-2] and $indent->[-1] <= $indent->[-2] ) { + croak("YAML::Tiny found bad indenting in line '$lines->[0]'"); + } + + # Pull the lines + my @multiline = (); + while ( @$lines ) { + $lines->[0] =~ /^(\s*)/; + last unless length($1) >= $indent->[-1]; + push @multiline, substr(shift(@$lines), length($1)); + } + + my $j = (substr($string, 0, 1) eq '>') ? ' ' : "\n"; + my $t = (substr($string, 1, 1) eq '-') ? '' : "\n"; + return join( $j, @multiline ) . $t; +} + +# Parse an array +sub _read_array { + my ($self, $array, $indent, $lines) = @_; + + while ( @$lines ) { + # Check for a new document + if ( $lines->[0] =~ /^(?:---|\.\.\.)/ ) { + while ( @$lines and $lines->[0] !~ /^---/ ) { + shift @$lines; + } + return 1; + } + + # Check the indent level + $lines->[0] =~ /^(\s*)/; + if ( length($1) < $indent->[-1] ) { + return 1; + } elsif ( length($1) > $indent->[-1] ) { + croak("YAML::Tiny found bad indenting in line '$lines->[0]'"); + } + + if ( $lines->[0] =~ /^(\s*\-\s+)[^\'\"]\S*\s*:(?:\s+|$)/ ) { + # Inline nested hash + my $indent2 = length("$1"); + $lines->[0] =~ s/-/ /; + push @$array, { }; + $self->_read_hash( $array->[-1], [ @$indent, $indent2 ], $lines ); + + } elsif ( $lines->[0] =~ /^\s*\-(\s*)(.+?)\s*\z/ ) { + # Array entry with a value + shift @$lines; + push @$array, $self->_read_scalar( "$2", [ @$indent, undef ], $lines ); + + } elsif ( $lines->[0] =~ /^\s*\-\s*\z/ ) { + shift @$lines; + unless ( @$lines ) { + push @$array, undef; + return 1; + } + if ( $lines->[0] =~ /^(\s*)\-/ ) { + my $indent2 = length("$1"); + if ( $indent->[-1] == $indent2 ) { + # Null array entry + push @$array, undef; + } else { + # Naked indenter + push @$array, [ ]; + $self->_read_array( $array->[-1], [ @$indent, $indent2 ], $lines ); + } + + } elsif ( $lines->[0] =~ /^(\s*)\S/ ) { + push @$array, { }; + $self->_read_hash( $array->[-1], [ @$indent, length("$1") ], $lines ); + + } else { + croak("YAML::Tiny failed to classify line '$lines->[0]'"); + } + + } elsif ( defined $indent->[-2] and $indent->[-1] == $indent->[-2] ) { + # This is probably a structure like the following... + # --- + # foo: + # - list + # bar: value + # + # ... so lets return and let the hash parser handle it + return 1; + + } else { + croak("YAML::Tiny failed to classify line '$lines->[0]'"); + } + } + + return 1; +} + +# Parse an array +sub _read_hash { + my ($self, $hash, $indent, $lines) = @_; + + while ( @$lines ) { + # Check for a new document + if ( $lines->[0] =~ /^(?:---|\.\.\.)/ ) { + while ( @$lines and $lines->[0] !~ /^---/ ) { + shift @$lines; + } + return 1; + } + + # Check the indent level + $lines->[0] =~ /^(\s*)/; + if ( length($1) < $indent->[-1] ) { + return 1; + } elsif ( length($1) > $indent->[-1] ) { + croak("YAML::Tiny found bad indenting in line '$lines->[0]'"); + } + + # Get the key + unless ( $lines->[0] =~ s/^\s*([^\'\" ][^\n]*?)\s*:(\s+|$)// ) { + if ( $lines->[0] =~ /^\s*[?\'\"]/ ) { + croak("YAML::Tiny does not support a feature in line '$lines->[0]'"); + } + croak("YAML::Tiny failed to classify line '$lines->[0]'"); + } + my $key = $1; + + # Do we have a value? + if ( length $lines->[0] ) { + # Yes + $hash->{$key} = $self->_read_scalar( shift(@$lines), [ @$indent, undef ], $lines ); + } else { + # An indent + shift @$lines; + unless ( @$lines ) { + $hash->{$key} = undef; + return 1; + } + if ( $lines->[0] =~ /^(\s*)-/ ) { + $hash->{$key} = []; + $self->_read_array( $hash->{$key}, [ @$indent, length($1) ], $lines ); + } elsif ( $lines->[0] =~ /^(\s*)./ ) { + my $indent2 = length("$1"); + if ( $indent->[-1] >= $indent2 ) { + # Null hash entry + $hash->{$key} = undef; + } else { + $hash->{$key} = {}; + $self->_read_hash( $hash->{$key}, [ @$indent, length($1) ], $lines ); + } + } + } + } + + return 1; +} + +# Set error +sub _error { + $YAML::Tiny::errstr = $_[1]; + undef; +} + +# Retrieve error +sub errstr { + $YAML::Tiny::errstr; +} + + + +##################################################################### +# Use Scalar::Util if possible, otherwise emulate it + +BEGIN { + eval { + require Scalar::Util; + }; + if ( $@ ) { + # Failed to load Scalar::Util + eval <<'END_PERL'; +sub refaddr { + my $pkg = ref($_[0]) or return undef; + if (!!UNIVERSAL::can($_[0], 'can')) { + bless $_[0], 'Scalar::Util::Fake'; + } else { + $pkg = undef; + } + "$_[0]" =~ /0x(\w+)/; + my $i = do { local $^W; hex $1 }; + bless $_[0], $pkg if defined $pkg; + $i; +} +END_PERL + } else { + Scalar::Util->import('refaddr'); + } +} + + +##################################################################### +# main test +##################################################################### + +package main; + +BEGIN { + + # Skip modules that either don't want to be loaded directly, such as + # Module::Install, or that mess with the test count, such as the Test::* + # modules listed here. + # + # Moose::Role conflicts if Moose is loaded as well, but Moose::Role is in + # the Moose distribution and it's certain that someone who uses + # Moose::Role also uses Moose somewhere, so if we disallow Moose::Role, + # we'll still get the relevant version number. + + my %skip = map { $_ => 1 } qw( + App::FatPacker + Class::Accessor::Classy + Module::Install + Moose::Role + Test::YAML::Meta + Test::Pod::Coverage + Test::Portability::Files + ); + + my $Test = Test::Builder->new; + + $Test->plan(skip_all => "META.yml could not be found") + unless -f 'META.yml' and -r _; + + my $meta = (Local::YAML::Tiny->read('META.yml'))->[0]; + my %requires; + for my $require_key (grep { /requires/ } keys %$meta) { + my %h = %{ $meta->{$require_key} }; + $requires{$_}++ for keys %h; + } + delete $requires{perl}; + + diag("Testing with Perl $], $^X"); + for my $module (sort keys %requires) { + if ($skip{$module}) { + note "$module doesn't want to be loaded directly, skipping"; + next; + } + local $SIG{__WARN__} = sub { note "$module: $_[0]" }; + use_ok $module or BAIL_OUT("can't load $module"); + my $version = $module->VERSION; + $version = 'undefined' unless defined $version; + diag(" $module version is $version"); + } + done_testing; +} diff --git a/t/eval.t b/t/eval.t new file mode 100644 index 0000000..f9e783c --- /dev/null +++ b/t/eval.t @@ -0,0 +1,31 @@ +#!perl -Tw + +use strict; +use warnings; + +use Test::More tests => 3; + +BEGIN { + use_ok( 'Template' ); +} + +BEGIN { + use_ok( 'Template::ShowStartStop' ); +} + +my $tt = + Template->new( { + CONTEXT => Template::ShowStartStop->new + } ); + +my $block = q{[% thing = 'doohickey' %]}; + +TODO: { # See RT # 13225 + local $TODO = 'Problem identified but not fixed'; + my $rc = $tt->process( \*DATA, { block => $block } ); + ok( $rc, 'eval' ); +} + +__DATA__ +[% block | eval %] +[% thing %] diff --git a/t/release-pod-coverage.t b/t/release-pod-coverage.t new file mode 100644 index 0000000..f8b3ebd --- /dev/null +++ b/t/release-pod-coverage.t @@ -0,0 +1,21 @@ +#!perl + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + + +use Test::More; + +eval "use Test::Pod::Coverage 1.08"; +plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage" + if $@; + +eval "use Pod::Coverage::TrustPod"; +plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage" + if $@; + +all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); \ No newline at end of file diff --git a/t/release-pod-syntax.t b/t/release-pod-syntax.t new file mode 100644 index 0000000..ba4e570 --- /dev/null +++ b/t/release-pod-syntax.t @@ -0,0 +1,15 @@ +#!perl + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + +use Test::More; + +eval "use Test::Pod 1.00"; +plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; + +all_pod_files_ok(); \ No newline at end of file diff --git a/t/release-synopsis.t b/t/release-synopsis.t new file mode 100644 index 0000000..f30a1da --- /dev/null +++ b/t/release-synopsis.t @@ -0,0 +1,16 @@ +#!perl + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + + +use Test::More; + +eval "use Test::Synopsis"; +plan skip_all => "Test::Synopsis required for testing synopses" + if $@; +all_synopsis_ok('lib'); \ No newline at end of file From 5026316503fb2b0d488c9163d138729c11aaed77 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 28 Apr 2010 02:08:32 -0400 Subject: [PATCH 048/140] reorganize --- dist.ini | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dist.ini b/dist.ini index 7c09126..8268f06 100644 --- a/dist.ini +++ b/dist.ini @@ -8,8 +8,11 @@ copyright_holder = Caleb Cushing [@Filter] bundle = @Basic remove = GatherDir + [GatherDir] -root = src + root = src +[CopyTo] + dir = . [AutoPrereq] @@ -25,8 +28,6 @@ root = src [SynopsisTests] [ReportVersions] -[CopyTo] - dir = . [@Git] push_to = my From 9471d5cb2341b847971679a62f392b37a7d7a8c9 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 28 Apr 2010 02:22:54 -0400 Subject: [PATCH 049/140] generate Readme from pod --- README | 52 ++++++++++++++++++++++++++++++++++++++++++++++------ dist.ini | 3 ++- 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/README b/README index 41ca54a..628bff3 100644 --- a/README +++ b/README @@ -1,13 +1,53 @@ +NAME + Template::ShowStartStop - Display where template's start and stop +VERSION + version 0.06 -This archive contains the distribution Template-ShowStartStop, -version 0.06: +SYNOPSIS + use Template::ShowStartStop; - Display where template's start and stop + my %config = ( # Whatever your config is + INCLUDE_PATH => '/my/template/path', + COMPILE_EXT => '.ttc', + COMPILE_DIR => '/tmp/tt', + ); -This software is copyright (c) 2010 by Caleb Cushing. + $config{ CONTEXT } = Template::ShowStartStop->new( %config ); -This is free software; you can redistribute it and/or modify it under -the same terms as the Perl 5 programming language system itself. + my $template = Template->new( \%config ); +DESCRIPTION + Template::ShowStartStop provides inline comments througout your code + where each template stops and starts. It's an overridden version of + Template::Context that wraps the "process()" method. + + Using Template::ShowStartStop is simple. Now when you process templates, + HTML comments will get embedded in your output, which you can easily + grep for. The nesting level is also shown. + + + + + .... + + + +BUGS + Please report any bugs or feature requests on + as I'm + not fond of RT. + +ACKNOWLEDGEMENTS + Thanks to Andy Lester, Randal Schwartz, Bill Moseley, and to Gavin Estey + for the original Template::Timer code that this is based on. + +AUTHOR + Caleb Cushing + +COPYRIGHT AND LICENSE + This software is copyright (c) 2010 by Caleb Cushing. + + This is free software; you can redistribute it and/or modify it under + the same terms as the Perl 5 programming language system itself. diff --git a/dist.ini b/dist.ini index 8268f06..1209faa 100644 --- a/dist.ini +++ b/dist.ini @@ -5,9 +5,11 @@ author = Caleb Cushing license = Perl_5 copyright_holder = Caleb Cushing +[ReadmeFromPod] [@Filter] bundle = @Basic remove = GatherDir +remove = Readme [GatherDir] root = src @@ -28,7 +30,6 @@ remove = GatherDir [SynopsisTests] [ReportVersions] - [@Git] push_to = my tag_format = %v From 9ec71ca4c20ba29398ee2c901126c6a0429fc4ed Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 28 Apr 2010 03:03:43 -0400 Subject: [PATCH 050/140] change changelog date format. update changelog --- Changes | 5 ++++- dist.ini | 1 + src/Changes | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 7bd32c1..5dfbb22 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Template::ShowStartStop -0.06 2010-04-28 01:41:46 America/Detroit +0.06 Apr 28 2010 +==================================== +Migrate completely to Dist::Zilla + 0.05 Apr 26 2010 ==================================== change back to ternary. diff --git a/dist.ini b/dist.ini index 1209faa..528b4f1 100644 --- a/dist.ini +++ b/dist.ini @@ -23,6 +23,7 @@ remove = Readme [Repository] [NextRelease] + format = %-9v %{MMM dd yyyy}d [ExtraTests] [PodSyntaxTests] diff --git a/src/Changes b/src/Changes index d82865a..b270e8f 100644 --- a/src/Changes +++ b/src/Changes @@ -1,5 +1,8 @@ Revision history for Template::ShowStartStop {{$NEXT}} +==================================== +Migrate completely to Dist::Zilla + 0.05 Apr 26 2010 ==================================== change back to ternary. From 7f3b1ab678972486a5741fadcf4bdfdeb46c97dd Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 28 Apr 2010 15:54:26 -0400 Subject: [PATCH 051/140] had 'include' instead of 'process' in docs --- README | 6 +++--- lib/Template/ShowStartStop.pm | 6 +++--- src/lib/Template/ShowStartStop.pm | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README b/README index 628bff3..afbfaba 100644 --- a/README +++ b/README @@ -26,12 +26,12 @@ DESCRIPTION HTML comments will get embedded in your output, which you can easily grep for. The nesting level is also shown. - - + + .... - + BUGS Please report any bugs or feature requests on diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index f36be9f..9815f0a 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -71,12 +71,12 @@ Using Template::ShowStartStop is simple. Now when you process templates, HTML comments will get embedded in your output, which you can easily grep for. The nesting level is also shown. - - + + .... - + =head1 BUGS diff --git a/src/lib/Template/ShowStartStop.pm b/src/lib/Template/ShowStartStop.pm index 1b27c9d..3c83317 100644 --- a/src/lib/Template/ShowStartStop.pm +++ b/src/lib/Template/ShowStartStop.pm @@ -58,12 +58,12 @@ Using Template::ShowStartStop is simple. Now when you process templates, HTML comments will get embedded in your output, which you can easily grep for. The nesting level is also shown. - - + + .... - + =head1 BUGS From ecb9bcb90a0e4c242fbdf380530f83a019017e63 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 28 Apr 2010 18:02:22 -0400 Subject: [PATCH 052/140] add CompileTests --- MANIFEST | 1 + META.yml | 2 ++ Makefile.PL | 4 +++- dist.ini | 1 + t/00-compile.t | 44 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 t/00-compile.t diff --git a/MANIFEST b/MANIFEST index 7c31800..d268e4d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -5,6 +5,7 @@ META.yml Makefile.PL README lib/Template/ShowStartStop.pm +t/00-compile.t t/00-load.t t/000-report-versions.t t/eval.t diff --git a/META.yml b/META.yml index baf5a02..460da5a 100644 --- a/META.yml +++ b/META.yml @@ -4,6 +4,8 @@ author: - 'Caleb Cushing ' build_requires: Carp: 0 + File::Find: 0 + File::Temp: 0 Scalar::Util: 0 Test::More: 0.88 perl: 5.004 diff --git a/Makefile.PL b/Makefile.PL index 70e2eee..79b9639 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -19,9 +19,11 @@ my %WriteMakefileArgs = ( }, 'AUTHOR' => 'Caleb Cushing ', 'BUILD_REQUIRES' => { + 'perl' => '5.004', 'Test::More' => '0.88', 'Scalar::Util' => '0', - 'perl' => '5.004', + 'File::Find' => '0', + 'File::Temp' => '0', 'Carp' => '0' }, 'ABSTRACT' => 'Display where template\'s start and stop', diff --git a/dist.ini b/dist.ini index 528b4f1..b4f99fd 100644 --- a/dist.ini +++ b/dist.ini @@ -30,6 +30,7 @@ remove = Readme [PodCoverageTests] [SynopsisTests] [ReportVersions] +[CompileTests] [@Git] push_to = my diff --git a/t/00-compile.t b/t/00-compile.t new file mode 100644 index 0000000..dde11d9 --- /dev/null +++ b/t/00-compile.t @@ -0,0 +1,44 @@ +#!perl + +use strict; +use warnings; + +use Test::More; +use File::Find; +use File::Temp qw{ tempdir }; + +my @modules; +find( + sub { + return if $File::Find::name !~ /\.pm\z/; + my $found = $File::Find::name; + $found =~ s{^lib/}{}; + $found =~ s{[/\\]}{::}g; + $found =~ s/\.pm$//; + # nothing to skip + push @modules, $found; + }, + 'lib', +); + +my @scripts = glob "bin/*"; + +plan tests => scalar(@modules) + scalar(@scripts); + +{ + # fake home for cpan-testers + # no fake requested ## local $ENV{HOME} = tempdir( CLEANUP => 1 ); + + is( qx{ $^X -Ilib -e "use $_; print '$_ ok'" }, "$_ ok", "$_ loaded ok" ) + for sort @modules; + + SKIP: { + eval "use Test::Script; 1;"; + skip "Test::Script needed to test script compilation", scalar(@scripts) if $@; + foreach my $file ( @scripts ) { + my $script = $file; + $script =~ s!.*/!!; + script_compiles_ok( $file, "$script script compiles" ); + } + } +} From 7cd2586a0d14ff0162b40b09b426d2b39e3ddcda Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 29 Apr 2010 04:01:01 -0400 Subject: [PATCH 053/140] remove test made redundant by compile test --- MANIFEST | 1 - src/t/00-load.t | 12 ------------ t/00-load.t | 12 ------------ 3 files changed, 25 deletions(-) delete mode 100644 src/t/00-load.t delete mode 100644 t/00-load.t diff --git a/MANIFEST b/MANIFEST index d268e4d..019dd0d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -6,7 +6,6 @@ Makefile.PL README lib/Template/ShowStartStop.pm t/00-compile.t -t/00-load.t t/000-report-versions.t t/eval.t t/release-pod-coverage.t diff --git a/src/t/00-load.t b/src/t/00-load.t deleted file mode 100644 index 0b4198b..0000000 --- a/src/t/00-load.t +++ /dev/null @@ -1,12 +0,0 @@ -#!perl - -use strict; -use warnings; - -use Test::More tests => 1; - -BEGIN { - use_ok( 'Template::ShowStartStop' ); -} - -diag( "Testing Template::ShowStartStop $Template::ShowStartStop::VERSION" ); diff --git a/t/00-load.t b/t/00-load.t deleted file mode 100644 index 0b4198b..0000000 --- a/t/00-load.t +++ /dev/null @@ -1,12 +0,0 @@ -#!perl - -use strict; -use warnings; - -use Test::More tests => 1; - -BEGIN { - use_ok( 'Template::ShowStartStop' ); -} - -diag( "Testing Template::ShowStartStop $Template::ShowStartStop::VERSION" ); From 0ab75084103caa28aed028c3a541d16191200f7f Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 30 Apr 2010 14:40:55 -0400 Subject: [PATCH 054/140] updated Dist::Zilla --- META.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/META.yml b/META.yml index 460da5a..b701dc9 100644 --- a/META.yml +++ b/META.yml @@ -11,7 +11,7 @@ build_requires: perl: 5.004 configure_requires: ExtUtils::MakeMaker: 6.31 -generated_by: 'Dist::Zilla version 2.101160' +generated_by: 'Dist::Zilla version 2.101170' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html From 729c84dbb8d297c535b93149ca6f836c5c21829c Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 5 May 2010 11:33:16 -0400 Subject: [PATCH 055/140] add MinimumVersionTests --- MANIFEST | 1 + dist.ini | 1 + t/release-minimum-version.t | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 t/release-minimum-version.t diff --git a/MANIFEST b/MANIFEST index 019dd0d..e603598 100644 --- a/MANIFEST +++ b/MANIFEST @@ -8,6 +8,7 @@ lib/Template/ShowStartStop.pm t/00-compile.t t/000-report-versions.t t/eval.t +t/release-minimum-version.t t/release-pod-coverage.t t/release-pod-syntax.t t/release-synopsis.t \ No newline at end of file diff --git a/dist.ini b/dist.ini index b4f99fd..78f3838 100644 --- a/dist.ini +++ b/dist.ini @@ -31,6 +31,7 @@ remove = Readme [SynopsisTests] [ReportVersions] [CompileTests] +[MinimumVersionTests] [@Git] push_to = my diff --git a/t/release-minimum-version.t b/t/release-minimum-version.t new file mode 100644 index 0000000..3b1635b --- /dev/null +++ b/t/release-minimum-version.t @@ -0,0 +1,16 @@ +#!perl + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + + +use Test::More; + +eval "use Test::MinimumVersion"; +plan skip_all => "Test::MinimumVersion required for testing minimum versions" + if $@; +all_minimum_version_from_metayml_ok(); \ No newline at end of file From 1459a53ba01c4c93cbb171bce957fbdb02958e09 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 10 May 2010 13:43:33 -0400 Subject: [PATCH 056/140] fix licensing issues for version 0.07 --- LICENSE | 1153 ++++++++++++++++++++++++--------- META.yml | 6 +- README | 8 +- dist.ini | 4 +- lib/Template/ShowStartStop.pm | 12 +- src/Changes | 4 + 6 files changed, 865 insertions(+), 322 deletions(-) diff --git a/LICENSE b/LICENSE index 9f49929..9909e17 100644 --- a/LICENSE +++ b/LICENSE @@ -1,233 +1,663 @@ + This software is copyright (c) 2010 by Caleb Cushing. This is free software; you can redistribute it and/or modify it under -the same terms as the Perl 5 programming language system itself. - -Terms of the Perl programming language system itself +one of the following licenses a) the GNU General Public License as published by the Free - Software Foundation; either version 1, or (at your option) any + Software Foundation; either version 3, or (at your option) any later version, or -b) the "Artistic License" +b) the "Artistic License 2.0" ---- The GNU General Public License, Version 1, February 1989 --- + +--- The GNU General Public License, Version 3, June 2007 --- This software is Copyright (c) 2010 by Caleb Cushing. This is free software, licensed under: - The GNU General Public License, Version 1, February 1989 + The GNU General Public License, Version 3, June 2007 - GNU GENERAL PUBLIC LICENSE - Version 1, February 1989 + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 - Copyright (C) 1989 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. - The license agreements of most software companies try to keep users -at the mercy of those companies. By contrast, our General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. The -General Public License applies to the Free Software Foundation's -software and to any other program whose authors commit to using it. -You can use it for your programs, too. + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. When we speak of free software, we are referring to freedom, not -price. Specifically, the General Public License is designed to make -sure that you have the freedom to give away or sell copies of free -software, that you receive source code or can get it if you want it, -that you can change the software or use pieces of it in new free -programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of a such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must tell them their rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any program or other work which -contains a notice placed by the copyright holder saying it may be -distributed under the terms of this General Public License. The -"Program", below, refers to any such program or work, and a "work based -on the Program" means either the Program or any work containing the -Program or a portion of it, either verbatim or with modifications. Each -licensee is addressed as "you". - - 1. You may copy and distribute verbatim copies of the Program's source -code as you receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice and -disclaimer of warranty; keep intact all the notices that refer to this -General Public License and to the absence of any warranty; and give any -other recipients of the Program a copy of this General Public License -along with the Program. You may charge a fee for the physical act of -transferring a copy. - - 2. You may modify your copy or copies of the Program or any portion of -it, and copy and distribute such modifications under the terms of Paragraph -1 above, provided that you also do the following: - - a) cause the modified files to carry prominent notices stating that - you changed the files and the date of any change; and - - b) cause the whole of any work that you distribute or publish, that - in whole or in part contains the Program or any part thereof, either - with or without modifications, to be licensed at no charge to all - third parties under the terms of this General Public License (except - that you may choose to grant warranty protection to some or all - third parties, at your option). - - c) If the modified program normally reads commands interactively when - run, you must cause it, when started running for such interactive use - in the simplest and most usual way, to print or display an - announcement including an appropriate copyright notice and a notice - that there is no warranty (or else, saying that you provide a - warranty) and that users may redistribute the program under these - conditions, and telling the user how to view a copy of this General - Public License. - - d) You may charge a fee for the physical act of transferring a - copy, and you may at your option offer warranty protection in - exchange for a fee. - -Mere aggregation of another independent work with the Program (or its -derivative) on a volume of a storage or distribution medium does not bring -the other work under the scope of these terms. - - 3. You may copy and distribute the Program (or a portion or derivative of -it, under Paragraph 2) in object code or executable form under the terms of -Paragraphs 1 and 2 above provided that you also do one of the following: - - a) accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of - Paragraphs 1 and 2 above; or, - - b) accompany it with a written offer, valid for at least three - years, to give any third party free (except for a nominal charge - for the cost of distribution) a complete machine-readable copy of the - corresponding source code, to be distributed under the terms of - Paragraphs 1 and 2 above; or, - - c) accompany it with the information you received as to where the - corresponding source code may be obtained. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form alone.) - -Source code for a work means the preferred form of the work for making -modifications to it. For an executable file, complete source code means -all the source code for all modules it contains; but, as a special -exception, it need not include source code for modules which are standard -libraries that accompany the operating system on which the executable -file runs, or for standard header files or definitions files that -accompany that operating system. - - 4. You may not copy, modify, sublicense, distribute or transfer the -Program except as expressly provided under this General Public License. -Any attempt otherwise to copy, modify, sublicense, distribute or transfer -the Program is void, and will automatically terminate your rights to use -the Program under this License. However, parties who have received -copies, or rights to use copies, from you under this General Public -License will not have their licenses terminated so long as such parties -remain in full compliance. - - 5. By copying, distributing or modifying the Program (or any work based -on the Program) you indicate your acceptance of this license to do so, -and all its terms and conditions. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the original -licensor to copy, distribute or modify the Program subject to these -terms and conditions. You may not impose any further restrictions on the -recipients' exercise of the rights granted herein. - - 7. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. -Each version is given a distinguishing version number. If the Program -specifies a version number of the license which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -the license, you may choose any version ever published by the Free Software -Foundation. - - 8. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest -possible use to humanity, the best way to achieve this is to make it -free software which everyone can redistribute and change under these -terms. +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. - To do so, attach the following notices to the program. It is safest to -attach them to the start of each source file to most effectively convey -the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. - Copyright (C) 19yy + Copyright (C) - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 1, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -235,143 +665,242 @@ the exclusion of warranty; and each file should have at least the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) 19xx name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. -The hypothetical commands `show w' and `show c' should show the -appropriate parts of the General Public License. Of course, the -commands you use may be called something other than `show w' and `show -c'; they could even be mouse-clicks or menu items--whatever suits your -program. +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here a sample; alter the names: + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. - Yoyodyne, Inc., hereby disclaims all copyright interest in the - program `Gnomovision' (a program to direct compilers to make passes - at assemblers) written by James Hacker. + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. - , 1 April 1989 - Ty Coon, President of Vice -That's all there is to it! - - ---- The Artistic License 1.0 --- +--- The Artistic License 2.0 --- This software is Copyright (c) 2010 by Caleb Cushing. This is free software, licensed under: - The Artistic License 1.0 + The Artistic License 2.0 + + The Artistic License 2.0 + + Copyright (c) 2000-2006, The Perl Foundation. -The Artistic License + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. Preamble -The intent of this document is to state the conditions under which a Package -may be copied, such that the Copyright Holder maintains some semblance of -artistic control over the development of the package, while giving the users of -the package the right to use and distribute the Package in a more-or-less -customary fashion, plus the right to make reasonable modifications. +This license establishes the terms under which a given free software +Package may be copied, modified, distributed, and/or redistributed. +The intent is that the Copyright Holder maintains some artistic +control over the development of that Package while still keeping the +Package available as open source and free software. + +You are always permitted to make arrangements wholly outside of this +license directly with the Copyright Holder of a given Package. If the +terms of this license do not permit the full use that you propose to +make of the Package, you should contact the Copyright Holder and seek +a different licensing arrangement. + +Definitions + + "Copyright Holder" means the individual(s) or organization(s) + named in the copyright notice for the entire Package. + + "Contributor" means any party that has contributed code or other + material to the Package, in accordance with the Copyright Holder's + procedures. + + "You" and "your" means any person who would like to copy, + distribute, or modify the Package. + + "Package" means the collection of files distributed by the + Copyright Holder, and derivatives of that collection and/or of + those files. A given Package may consist of either the Standard + Version, or a Modified Version. + + "Distribute" means providing a copy of the Package or making it + accessible to anyone else, or in the case of a company or + organization, to others outside of your company or organization. -Definitions: + "Distributor Fee" means any fee that you charge for Distributing + this Package or providing support for this Package to another + party. It does not mean licensing fees. - - "Package" refers to the collection of files distributed by the Copyright - Holder, and derivatives of that collection of files created through - textual modification. - - "Standard Version" refers to such a Package if it has not been modified, - or has been modified in accordance with the wishes of the Copyright + "Standard Version" refers to the Package if it has not been + modified, or has been modified only in ways explicitly requested + by the Copyright Holder. + + "Modified Version" means the Package, if it has been changed, and + such changes were not explicitly requested by the Copyright Holder. - - "Copyright Holder" is whoever is named in the copyright or copyrights for - the package. - - "You" is you, if you're thinking about copying or distributing this Package. - - "Reasonable copying fee" is whatever you can justify on the basis of media - cost, duplication charges, time of people involved, and so on. (You will - not be required to justify it to the Copyright Holder, but only to the - computing community at large as a market that must bear the fee.) - - "Freely Available" means that no fee is charged for the item itself, though - there may be fees involved in handling the item. It also means that - recipients of the item may redistribute it under the same conditions they - received it. - -1. You may make and give away verbatim copies of the source form of the -Standard Version of this Package without restriction, provided that you -duplicate all of the original copyright notices and associated disclaimers. - -2. You may apply bug fixes, portability fixes and other modifications derived -from the Public Domain or from the Copyright Holder. A Package modified in such -a way shall still be considered the Standard Version. - -3. You may otherwise modify your copy of this Package in any way, provided that -you insert a prominent notice in each changed file stating how and when you -changed that file, and provided that you do at least ONE of the following: - - a) place your modifications in the Public Domain or otherwise make them - Freely Available, such as by posting said modifications to Usenet or an - equivalent medium, or placing the modifications on a major archive site - such as ftp.uu.net, or by allowing the Copyright Holder to include your - modifications in the Standard Version of the Package. - - b) use the modified Package only within your corporation or organization. - - c) rename any non-standard executables so the names do not conflict with - standard executables, which must also be provided, and provide a separate - manual page for each non-standard executable that clearly documents how it - differs from the Standard Version. - - d) make other distribution arrangements with the Copyright Holder. - -4. You may distribute the programs of this Package in object code or executable -form, provided that you do at least ONE of the following: - - a) distribute a Standard Version of the executables and library files, - together with instructions (in the manual page or equivalent) on where to - get the Standard Version. - - b) accompany the distribution with the machine-readable source of the Package - with your modifications. - - c) accompany any non-standard executables with their corresponding Standard - Version executables, giving the non-standard executables non-standard - names, and clearly documenting the differences in manual pages (or - equivalent), together with instructions on where to get the Standard - Version. - - d) make other distribution arrangements with the Copyright Holder. - -5. You may charge a reasonable copying fee for any distribution of this -Package. You may charge any fee you choose for support of this Package. You -may not charge a fee for this Package itself. However, you may distribute this -Package in aggregate with other (possibly commercial) programs as part of a -larger (possibly commercial) software distribution provided that you do not -advertise this Package as a product of your own. - -6. The scripts and library files supplied as input to or produced as output -from the programs of this Package do not automatically fall under the copyright -of this Package, but belong to whomever generated them, and may be sold -commercially, and may be aggregated with this Package. - -7. C or perl subroutines supplied by you and linked into this Package shall not -be considered part of this Package. - -8. The name of the Copyright Holder may not be used to endorse or promote -products derived from this software without specific prior written permission. - -9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -The End + + "Original License" means this Artistic License as Distributed with + the Standard Version of the Package, in its current version or as + it may be modified by The Perl Foundation in the future. + + "Source" form means the source code, documentation source, and + configuration files for the Package. + + "Compiled" form means the compiled bytecode, object code, binary, + or any other form resulting from mechanical transformation or + translation of the Source form. + + +Permission for Use and Modification Without Distribution + +(1) You are permitted to use the Standard Version and create and use +Modified Versions for any purpose without restriction, provided that +you do not Distribute the Modified Version. + + +Permissions for Redistribution of the Standard Version + +(2) You may Distribute verbatim copies of the Source form of the +Standard Version of this Package in any medium without restriction, +either gratis or for a Distributor Fee, provided that you duplicate +all of the original copyright notices and associated disclaimers. At +your discretion, such verbatim copies may or may not include a +Compiled form of the Package. + +(3) You may apply any bug fixes, portability changes, and other +modifications made available from the Copyright Holder. The resulting +Package will still be considered the Standard Version, and as such +will be subject to the Original License. + + +Distribution of Modified Versions of the Package as Source + +(4) You may Distribute your Modified Version as Source (either gratis +or for a Distributor Fee, and with or without a Compiled form of the +Modified Version) provided that you clearly document how it differs +from the Standard Version, including, but not limited to, documenting +any non-standard features, executables, or modules, and provided that +you do at least ONE of the following: + + (a) make the Modified Version available to the Copyright Holder + of the Standard Version, under the Original License, so that the + Copyright Holder may include your modifications in the Standard + Version. + + (b) ensure that installation of your Modified Version does not + prevent the user installing or running the Standard Version. In + addition, the Modified Version must bear a name that is different + from the name of the Standard Version. + + (c) allow anyone who receives a copy of the Modified Version to + make the Source form of the Modified Version available to others + under + + (i) the Original License or + + (ii) a license that permits the licensee to freely copy, + modify and redistribute the Modified Version using the same + licensing terms that apply to the copy that the licensee + received, and requires that the Source form of the Modified + Version, and of any works derived from it, be made freely + available in that license fees are prohibited but Distributor + Fees are allowed. + + +Distribution of Compiled Forms of the Standard Version +or Modified Versions without the Source + +(5) You may Distribute Compiled forms of the Standard Version without +the Source, provided that you include complete instructions on how to +get the Source of the Standard Version. Such instructions must be +valid at the time of your distribution. If these instructions, at any +time while you are carrying out such distribution, become invalid, you +must provide new instructions on demand or cease further distribution. +If you provide valid instructions or cease distribution within thirty +days after you become aware that the instructions are invalid, then +you do not forfeit any of your rights under this license. + +(6) You may Distribute a Modified Version in Compiled form without +the Source, provided that you comply with Section 4 with respect to +the Source of the Modified Version. + + +Aggregating or Linking the Package + +(7) You may aggregate the Package (either the Standard Version or +Modified Version) with other packages and Distribute the resulting +aggregation provided that you do not charge a licensing fee for the +Package. Distributor Fees are permitted, and licensing fees for other +components in the aggregation are permitted. The terms of this license +apply to the use and Distribution of the Standard or Modified Versions +as included in the aggregation. + +(8) You are permitted to link Modified and Standard Versions with +other works, to embed the Package in a larger work of your own, or to +build stand-alone binary or bytecode versions of applications that +include the Package, and Distribute the result without restriction, +provided the result does not expose a direct interface to the Package. + + +Items That are Not Considered Part of a Modified Version + +(9) Works (including, but not limited to, modules and scripts) that +merely extend or make use of the Package, do not, by themselves, cause +the Package to be a Modified Version. In addition, such works are not +considered parts of the Package itself, and are not subject to the +terms of this license. + + +General Provisions + +(10) Any use, modification, and distribution of the Standard or +Modified Versions is governed by this Artistic License. By using, +modifying or distributing the Package, you accept this license. Do not +use, modify, or distribute the Package, if you do not accept this +license. + +(11) If your Modified Version has been derived from a Modified +Version made by someone other than you, you are nevertheless required +to ensure that your Modified Version complies with the requirements of +this license. + +(12) This license does not grant you the right to use any trademark, +service mark, tradename, or logo of the Copyright Holder. + +(13) This license includes the non-exclusive, worldwide, +free-of-charge patent license to make, have made, use, offer to sell, +sell, import and otherwise transfer the Package with respect to any +patent claims licensable by the Copyright Holder that are necessarily +infringed by the Package. If you institute patent litigation +(including a cross-claim or counterclaim) against any party alleging +that the Package constitutes direct or contributory patent +infringement, then this Artistic License to you shall terminate on the +date that such litigation is filed. + +(14) Disclaimer of Warranty: +THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS +IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL +LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/META.yml b/META.yml index b701dc9..db55186 100644 --- a/META.yml +++ b/META.yml @@ -11,8 +11,8 @@ build_requires: perl: 5.004 configure_requires: ExtUtils::MakeMaker: 6.31 -generated_by: 'Dist::Zilla version 2.101170' -license: perl +generated_by: 'Dist::Zilla version 2.101241' +license: gpl3artistic2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 @@ -23,4 +23,4 @@ requires: parent: 0 resources: repository: http://github.com/xenoterracide/Template-ShowStartStop -version: 0.06 +version: 0.07 diff --git a/README b/README index afbfaba..86d5be5 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME Template::ShowStartStop - Display where template's start and stop VERSION - version 0.06 + version 0.07 SYNOPSIS use Template::ShowStartStop; @@ -49,5 +49,9 @@ COPYRIGHT AND LICENSE This software is copyright (c) 2010 by Caleb Cushing. This is free software; you can redistribute it and/or modify it under - the same terms as the Perl 5 programming language system itself. + one of the following licenses + + a) the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version, or + b) the "Artistic License 2.0" diff --git a/dist.ini b/dist.ini index 78f3838..7bb3608 100644 --- a/dist.ini +++ b/dist.ini @@ -1,8 +1,8 @@ name = Template-ShowStartStop abstract = Display where template's start and stop -version = 0.06 +version = 0.07 author = Caleb Cushing -license = Perl_5 +license = GPL3andArtistic2 copyright_holder = Caleb Cushing [ReadmeFromPod] diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index 9815f0a..6b64a14 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -1,6 +1,6 @@ package Template::ShowStartStop; BEGIN { - $Template::ShowStartStop::VERSION = '0.06'; + $Template::ShowStartStop::VERSION = '0.07'; } use strict; use warnings; @@ -45,7 +45,7 @@ Template::ShowStartStop - Display where template's start and stop =head1 VERSION -version 0.06 +version 0.07 =head1 SYNOPSIS @@ -98,10 +98,16 @@ and to Gavin Estey for the original Template::Timer code that this is based on. =head1 COPYRIGHT AND LICENSE + This software is copyright (c) 2010 by Caleb Cushing. This is free software; you can redistribute it and/or modify it under -the same terms as the Perl 5 programming language system itself. +one of the following licenses + +a) the GNU General Public License as published by the Free + Software Foundation; either version 3, or (at your option) any + later version, or +b) the "Artistic License 2.0" =cut diff --git a/src/Changes b/src/Changes index b270e8f..ce9bd13 100644 --- a/src/Changes +++ b/src/Changes @@ -1,6 +1,10 @@ Revision history for Template::ShowStartStop {{$NEXT}} ==================================== +Fix Licensing Issues + +0.06 May 10 2010 +==================================== Migrate completely to Dist::Zilla 0.05 Apr 26 2010 From 4df2f36f5c8d3a392f97e6fdb69eed0d11c3b188 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 10 May 2010 13:43:58 -0400 Subject: [PATCH 057/140] dzil reformatted Makefile.PL --- Makefile.PL | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 79b9639..399a70f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -9,32 +9,32 @@ use ExtUtils::MakeMaker 6.31; my %WriteMakefileArgs = ( - 'test' => { - 'TESTS' => 't/*.t' - }, - 'NAME' => 'Template::ShowStartStop', - 'DISTNAME' => 'Template-ShowStartStop', - 'CONFIGURE_REQUIRES' => { - 'ExtUtils::MakeMaker' => '6.31' - }, - 'AUTHOR' => 'Caleb Cushing ', - 'BUILD_REQUIRES' => { - 'perl' => '5.004', - 'Test::More' => '0.88', - 'Scalar::Util' => '0', - 'File::Find' => '0', - 'File::Temp' => '0', - 'Carp' => '0' - }, - 'ABSTRACT' => 'Display where template\'s start and stop', - 'EXE_FILES' => [], - 'VERSION' => '0.06', - 'PREREQ_PM' => { - 'parent' => '0', - 'Template::Context' => '0' - }, - 'LICENSE' => 'perl' - ); + 'ABSTRACT' => 'Display where template\'s start and stop', + 'AUTHOR' => 'Caleb Cushing ', + 'BUILD_REQUIRES' => { + 'Carp' => '0', + 'File::Find' => '0', + 'File::Temp' => '0', + 'Scalar::Util' => '0', + 'Test::More' => '0.88', + 'perl' => '5.004' + }, + 'CONFIGURE_REQUIRES' => { + 'ExtUtils::MakeMaker' => '6.31' + }, + 'DISTNAME' => 'Template-ShowStartStop', + 'EXE_FILES' => [], + 'LICENSE' => 'gpl3artistic2', + 'NAME' => 'Template::ShowStartStop', + 'PREREQ_PM' => { + 'Template::Context' => '0', + 'parent' => '0' + }, + 'VERSION' => '0.07', + 'test' => { + 'TESTS' => 't/*.t' + } +); unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { From d2491e3443f0d0cb5c1146a3370bb8a078dea583 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 10 May 2010 13:44:41 -0400 Subject: [PATCH 058/140] dzil bumped Test::Pod Requirements --- t/release-pod-syntax.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/release-pod-syntax.t b/t/release-pod-syntax.t index ba4e570..66c8fff 100644 --- a/t/release-pod-syntax.t +++ b/t/release-pod-syntax.t @@ -9,7 +9,7 @@ BEGIN { use Test::More; -eval "use Test::Pod 1.00"; -plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; +eval "use Test::Pod 1.41"; +plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; all_pod_files_ok(); \ No newline at end of file From 42d63340d8d8e4f21a6b519673cd402c9494a02a Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 10 May 2010 13:45:22 -0400 Subject: [PATCH 059/140] update Changes --- Changes | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 5dfbb22..19ce8c2 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ Revision history for Template::ShowStartStop -0.06 Apr 28 2010 +0.07 May 10 2010 +==================================== +Fix Licensing Issues + +0.06 May 10 2010 ==================================== Migrate completely to Dist::Zilla From 201dfac8dce745d7c1bcaa857f02a82897a76d67 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 21 May 2010 04:55:35 -0400 Subject: [PATCH 060/140] code cleanup and comments --- lib/Template/ShowStartStop.pm | 4 ++-- src/lib/Template/ShowStartStop.pm | 4 ++-- src/t/eval.t | 11 +++-------- t/eval.t | 11 +++-------- 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index 6b64a14..981c708 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -12,9 +12,9 @@ my $super = __PACKAGE__->can("SUPER::$sub") or die; my $wrapped = sub { my $self = shift; - my $what = shift; + my $what = shift; # what template are we working with - my $template + my $template # get the template filename # conditional # set $template to = ref($what) eq 'ARRAY' ? join( ' + ', @{$what} ) : ref($what) ? $what->name diff --git a/src/lib/Template/ShowStartStop.pm b/src/lib/Template/ShowStartStop.pm index 3c83317..f83eaeb 100644 --- a/src/lib/Template/ShowStartStop.pm +++ b/src/lib/Template/ShowStartStop.pm @@ -9,9 +9,9 @@ my $super = __PACKAGE__->can("SUPER::$sub") or die; my $wrapped = sub { my $self = shift; - my $what = shift; + my $what = shift; # what template are we working with - my $template + my $template # get the template filename # conditional # set $template to = ref($what) eq 'ARRAY' ? join( ' + ', @{$what} ) : ref($what) ? $what->name diff --git a/src/t/eval.t b/src/t/eval.t index f9e783c..92b09d4 100644 --- a/src/t/eval.t +++ b/src/t/eval.t @@ -1,17 +1,12 @@ -#!perl -Tw +#!perl -T use strict; use warnings; use Test::More tests => 3; -BEGIN { - use_ok( 'Template' ); -} - -BEGIN { - use_ok( 'Template::ShowStartStop' ); -} +BEGIN { use_ok( 'Template' ); } +BEGIN { use_ok( 'Template::ShowStartStop' ); } my $tt = Template->new( { diff --git a/t/eval.t b/t/eval.t index f9e783c..92b09d4 100644 --- a/t/eval.t +++ b/t/eval.t @@ -1,17 +1,12 @@ -#!perl -Tw +#!perl -T use strict; use warnings; use Test::More tests => 3; -BEGIN { - use_ok( 'Template' ); -} - -BEGIN { - use_ok( 'Template::ShowStartStop' ); -} +BEGIN { use_ok( 'Template' ); } +BEGIN { use_ok( 'Template::ShowStartStop' ); } my $tt = Template->new( { From 27cfd7c768798713fba9282d32c93550852f348c Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 21 May 2010 07:57:34 -0400 Subject: [PATCH 061/140] add basic functionality test --- src/t/basic.t | 32 ++++++++++++++++++++++++++++++++ t/basic.t | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 src/t/basic.t create mode 100644 t/basic.t diff --git a/src/t/basic.t b/src/t/basic.t new file mode 100644 index 0000000..e64ec58 --- /dev/null +++ b/src/t/basic.t @@ -0,0 +1,32 @@ +#!perl -T +use strict; +use warnings; + +use Test::More; + +BEGIN { use_ok( 'Template' ); } +BEGIN { use_ok( 'Template::ShowStartStop' ); } + +my $tt = Template->new({ + CONTEXT => Template::ShowStartStop->new +}); + +my $vars = { + var => 'world', +}; + +my $final_output = < +hello world + +END + +my $output = \do{ my $i }; #use anonymous scalar + +ok( $tt->process(\*DATA, $vars, $output), 'process template'); + +is( $$output, $final_output, 'test hello world output'); + +done_testing(); +__DATA__ +hello [% var %] diff --git a/t/basic.t b/t/basic.t new file mode 100644 index 0000000..e64ec58 --- /dev/null +++ b/t/basic.t @@ -0,0 +1,32 @@ +#!perl -T +use strict; +use warnings; + +use Test::More; + +BEGIN { use_ok( 'Template' ); } +BEGIN { use_ok( 'Template::ShowStartStop' ); } + +my $tt = Template->new({ + CONTEXT => Template::ShowStartStop->new +}); + +my $vars = { + var => 'world', +}; + +my $final_output = < +hello world + +END + +my $output = \do{ my $i }; #use anonymous scalar + +ok( $tt->process(\*DATA, $vars, $output), 'process template'); + +is( $$output, $final_output, 'test hello world output'); + +done_testing(); +__DATA__ +hello [% var %] From 46ea85b5d79979dc59b422ee11076a5731584b4e Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 21 May 2010 08:39:20 -0400 Subject: [PATCH 062/140] ignore vim temporary files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9f50c38..d1390ce 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ blib/ pm_to_blib Template-ShowStartStop-* .build +*.swp From c0c63b589a63a5e0294e9ae820c6303e0dfa89c5 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 21 May 2010 08:47:58 -0400 Subject: [PATCH 063/140] use simpler example in synopsis --- lib/Template/ShowStartStop.pm | 12 +++--------- src/lib/Template/ShowStartStop.pm | 12 +++--------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index 981c708..f8cc2d4 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -51,15 +51,9 @@ version 0.07 use Template::ShowStartStop; - my %config = ( # Whatever your config is - INCLUDE_PATH => '/my/template/path', - COMPILE_EXT => '.ttc', - COMPILE_DIR => '/tmp/tt', - ); - - $config{ CONTEXT } = Template::ShowStartStop->new( %config ); - - my $template = Template->new( \%config ); + my $tt = Template->new({ + CONTEXT => Template::ShowStartStop->new + }); =head1 DESCRIPTION diff --git a/src/lib/Template/ShowStartStop.pm b/src/lib/Template/ShowStartStop.pm index f83eaeb..da2b5ff 100644 --- a/src/lib/Template/ShowStartStop.pm +++ b/src/lib/Template/ShowStartStop.pm @@ -38,15 +38,9 @@ __END__ use Template::ShowStartStop; - my %config = ( # Whatever your config is - INCLUDE_PATH => '/my/template/path', - COMPILE_EXT => '.ttc', - COMPILE_DIR => '/tmp/tt', - ); - - $config{ CONTEXT } = Template::ShowStartStop->new( %config ); - - my $template = Template->new( \%config ); + my $tt = Template->new({ + CONTEXT => Template::ShowStartStop->new + }); =head1 DESCRIPTION From 08579ca4b3aebc54758ec356bf19268d1f95ced3 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 26 May 2010 02:25:51 -0400 Subject: [PATCH 064/140] upgrade report-versions --- t/000-report-versions.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/000-report-versions.t b/t/000-report-versions.t index 9bd7a00..6407bd7 100644 --- a/t/000-report-versions.t +++ b/t/000-report-versions.t @@ -1,7 +1,7 @@ #!perl use warnings; use strict; -use Test::More 0.88; +use Test::More 0.94; # Include a cut-down version of YAML::Tiny so we don't introduce unnecessary # dependencies ourselves. @@ -406,11 +406,13 @@ BEGIN { my %skip = map { $_ => 1 } qw( App::FatPacker Class::Accessor::Classy + Devel::Cover Module::Install Moose::Role - Test::YAML::Meta + Test::Kwalitee Test::Pod::Coverage Test::Portability::Files + Test::YAML::Meta ); my $Test = Test::Builder->new; From 80cc2e07e9a69f16e5a5a7c8a850733123f4742c Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 26 May 2010 02:29:11 -0400 Subject: [PATCH 065/140] add basic.t to manifest --- MANIFEST | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index e603598..22997a5 100644 --- a/MANIFEST +++ b/MANIFEST @@ -7,8 +7,9 @@ README lib/Template/ShowStartStop.pm t/00-compile.t t/000-report-versions.t +t/basic.t t/eval.t t/release-minimum-version.t t/release-pod-coverage.t t/release-pod-syntax.t -t/release-synopsis.t \ No newline at end of file +t/release-synopsis.t From ba83ce7890dbdb68258266203840e1731c039040 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 26 May 2010 02:32:27 -0400 Subject: [PATCH 066/140] upgrade dzil --- META.yml | 8 ++++---- Makefile.PL | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/META.yml b/META.yml index db55186..8d21a88 100644 --- a/META.yml +++ b/META.yml @@ -7,17 +7,17 @@ build_requires: File::Find: 0 File::Temp: 0 Scalar::Util: 0 - Test::More: 0.88 + Test::More: 0.94 perl: 5.004 configure_requires: ExtUtils::MakeMaker: 6.31 -generated_by: 'Dist::Zilla version 2.101241' -license: gpl3artistic2 +dynamic_config: 0 +generated_by: 'Dist::Zilla version 3.101450, CPAN::Meta::Converter version 2.101450' +license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Template-ShowStartStop -recommends: {} requires: Template::Context: 0 parent: 0 diff --git a/Makefile.PL b/Makefile.PL index 399a70f..53f9385 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -16,7 +16,7 @@ my %WriteMakefileArgs = ( 'File::Find' => '0', 'File::Temp' => '0', 'Scalar::Util' => '0', - 'Test::More' => '0.88', + 'Test::More' => '0.94', 'perl' => '5.004' }, 'CONFIGURE_REQUIRES' => { From d759e73cee3bfb8d4470c027c1b7db25c5c34169 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 26 May 2010 02:33:22 -0400 Subject: [PATCH 067/140] update SYNOPSIS change in README --- README | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/README b/README index 86d5be5..512380e 100644 --- a/README +++ b/README @@ -7,15 +7,9 @@ VERSION SYNOPSIS use Template::ShowStartStop; - my %config = ( # Whatever your config is - INCLUDE_PATH => '/my/template/path', - COMPILE_EXT => '.ttc', - COMPILE_DIR => '/tmp/tt', - ); - - $config{ CONTEXT } = Template::ShowStartStop->new( %config ); - - my $template = Template->new( \%config ); + my $tt = Template->new({ + CONTEXT => Template::ShowStartStop->new + }); DESCRIPTION Template::ShowStartStop provides inline comments througout your code From bb2e2f91a788a9fa8110f52da9dc00db89a0ecbe Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 26 May 2010 03:52:06 -0400 Subject: [PATCH 068/140] update license and bump version --- Changes | 6 + LICENSE | 699 ---------------------------------- META.yml | 4 +- Makefile.PL | 4 +- README | 11 +- dist.ini | 4 +- lib/Template/ShowStartStop.pm | 15 +- src/Changes | 6 + 8 files changed, 27 insertions(+), 722 deletions(-) diff --git a/Changes b/Changes index 19ce8c2..13c7efb 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,10 @@ Revision history for Template::ShowStartStop +0.08 May 26 2010 +==================================== +* Change License to Artistic 2.0 because dual license isn't required +* add basic functionality test +* simplify documentation + 0.07 May 10 2010 ==================================== Fix Licensing Issues diff --git a/LICENSE b/LICENSE index 9909e17..59c9cd3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,701 +1,3 @@ - -This software is copyright (c) 2010 by Caleb Cushing. - -This is free software; you can redistribute it and/or modify it under -one of the following licenses - -a) the GNU General Public License as published by the Free - Software Foundation; either version 3, or (at your option) any - later version, or -b) the "Artistic License 2.0" - - ---- The GNU General Public License, Version 3, June 2007 --- - -This software is Copyright (c) 2010 by Caleb Cushing. - -This is free software, licensed under: - - The GNU General Public License, Version 3, June 2007 - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. - - ---- The Artistic License 2.0 --- - This software is Copyright (c) 2010 by Caleb Cushing. This is free software, licensed under: @@ -903,4 +205,3 @@ LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/META.yml b/META.yml index 8d21a88..8e732d5 100644 --- a/META.yml +++ b/META.yml @@ -13,7 +13,7 @@ configure_requires: ExtUtils::MakeMaker: 6.31 dynamic_config: 0 generated_by: 'Dist::Zilla version 3.101450, CPAN::Meta::Converter version 2.101450' -license: unknown +license: artistic2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 @@ -23,4 +23,4 @@ requires: parent: 0 resources: repository: http://github.com/xenoterracide/Template-ShowStartStop -version: 0.07 +version: 0.08 diff --git a/Makefile.PL b/Makefile.PL index 53f9385..9cabe89 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -24,13 +24,13 @@ my %WriteMakefileArgs = ( }, 'DISTNAME' => 'Template-ShowStartStop', 'EXE_FILES' => [], - 'LICENSE' => 'gpl3artistic2', + 'LICENSE' => 'artistic_2', 'NAME' => 'Template::ShowStartStop', 'PREREQ_PM' => { 'Template::Context' => '0', 'parent' => '0' }, - 'VERSION' => '0.07', + 'VERSION' => '0.08', 'test' => { 'TESTS' => 't/*.t' } diff --git a/README b/README index 512380e..05f4cab 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME Template::ShowStartStop - Display where template's start and stop VERSION - version 0.07 + version 0.08 SYNOPSIS use Template::ShowStartStop; @@ -40,12 +40,9 @@ AUTHOR Caleb Cushing COPYRIGHT AND LICENSE - This software is copyright (c) 2010 by Caleb Cushing. + This software is Copyright (c) 2010 by Caleb Cushing. - This is free software; you can redistribute it and/or modify it under - one of the following licenses + This is free software, licensed under: - a) the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version, or - b) the "Artistic License 2.0" + The Artistic License 2.0 diff --git a/dist.ini b/dist.ini index 7bb3608..fd380dc 100644 --- a/dist.ini +++ b/dist.ini @@ -1,8 +1,8 @@ name = Template-ShowStartStop abstract = Display where template's start and stop -version = 0.07 +version = 0.08 author = Caleb Cushing -license = GPL3andArtistic2 +license = Artistic_2_0 copyright_holder = Caleb Cushing [ReadmeFromPod] diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index f8cc2d4..614bd19 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -1,6 +1,6 @@ package Template::ShowStartStop; BEGIN { - $Template::ShowStartStop::VERSION = '0.07'; + $Template::ShowStartStop::VERSION = '0.08'; } use strict; use warnings; @@ -45,7 +45,7 @@ Template::ShowStartStop - Display where template's start and stop =head1 VERSION -version 0.07 +version 0.08 =head1 SYNOPSIS @@ -92,16 +92,11 @@ and to Gavin Estey for the original Template::Timer code that this is based on. =head1 COPYRIGHT AND LICENSE +This software is Copyright (c) 2010 by Caleb Cushing. -This software is copyright (c) 2010 by Caleb Cushing. +This is free software, licensed under: -This is free software; you can redistribute it and/or modify it under -one of the following licenses - -a) the GNU General Public License as published by the Free - Software Foundation; either version 3, or (at your option) any - later version, or -b) the "Artistic License 2.0" + The Artistic License 2.0 =cut diff --git a/src/Changes b/src/Changes index ce9bd13..2d0043c 100644 --- a/src/Changes +++ b/src/Changes @@ -1,6 +1,12 @@ Revision history for Template::ShowStartStop {{$NEXT}} ==================================== +* Change License to Artistic 2.0 because dual license isn't required +* add basic functionality test +* simplify documentation + +0.07 May 10 2010 +==================================== Fix Licensing Issues 0.06 May 10 2010 From ba3591eb90b3c7da712a7b59f085223771707af9 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 26 May 2010 18:42:46 -0400 Subject: [PATCH 069/140] add Submitting patches from git.git --- src/SubmittingPatches | 593 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 593 insertions(+) create mode 100644 src/SubmittingPatches diff --git a/src/SubmittingPatches b/src/SubmittingPatches new file mode 100644 index 0000000..b9204c7 --- /dev/null +++ b/src/SubmittingPatches @@ -0,0 +1,593 @@ +Checklist (and a short version for the impatient): + + Commits: + + - make commits of logical units + - check for unnecessary whitespace with "git diff --check" + before committing + - do not check in commented out code or unneeded files + - the first line of the commit message should be a short + description and should skip the full stop + - the body should provide a meaningful commit message, which: + - uses the imperative, present tense: "change", + not "changed" or "changes". + - includes motivation for the change, and contrasts + its implementation with previous behaviour + - if you want your work included in git.git, add a + "Signed-off-by: Your Name " line to the + commit message (or just use the option "-s" when + committing) to confirm that you agree to the Developer's + Certificate of Origin + - make sure that you have tests for the bug you are fixing + - make sure that the test suite passes after your commit + + Patch: + + - use "git format-patch -M" to create the patch + - do not PGP sign your patch + - do not attach your patch, but read in the mail + body, unless you cannot teach your mailer to + leave the formatting of the patch alone. + - be careful doing cut & paste into your mailer, not to + corrupt whitespaces. + - provide additional information (which is unsuitable for + the commit message) between the "---" and the diffstat + - if you change, add, or remove a command line option or + make some other user interface change, the associated + documentation should be updated as well. + - if your name is not writable in ASCII, make sure that + you send off a message in the correct encoding. + - send the patch to the list (git@vger.kernel.org) and the + maintainer (gitster@pobox.com) if (and only if) the patch + is ready for inclusion. If you use git-send-email(1), + please test it first by sending email to yourself. + - see below for instructions specific to your mailer + +Long version: + +I started reading over the SubmittingPatches document for Linux +kernel, primarily because I wanted to have a document similar to +it for the core GIT to make sure people understand what they are +doing when they write "Signed-off-by" line. + +But the patch submission requirements are a lot more relaxed +here on the technical/contents front, because the core GIT is +thousand times smaller ;-). So here is only the relevant bits. + +(0) Decide what to base your work on. + +In general, always base your work on the oldest branch that your +change is relevant to. + + - A bugfix should be based on 'maint' in general. If the bug is not + present in 'maint', base it on 'master'. For a bug that's not yet + in 'master', find the topic that introduces the regression, and + base your work on the tip of the topic. + + - A new feature should be based on 'master' in general. If the new + feature depends on a topic that is in 'pu', but not in 'master', + base your work on the tip of that topic. + + - Corrections and enhancements to a topic not yet in 'master' should + be based on the tip of that topic. If the topic has not been merged + to 'next', it's alright to add a note to squash minor corrections + into the series. + + - In the exceptional case that a new feature depends on several topics + not in 'master', start working on 'next' or 'pu' privately and send + out patches for discussion. Before the final merge, you may have to + wait until some of the dependent topics graduate to 'master', and + rebase your work. + +To find the tip of a topic branch, run "git log --first-parent +master..pu" and look for the merge commit. The second parent of this +commit is the tip of the topic branch. + +(1) Make separate commits for logically separate changes. + +Unless your patch is really trivial, you should not be sending +out a patch that was generated between your working tree and +your commit head. Instead, always make a commit with complete +commit message and generate a series of patches from your +repository. It is a good discipline. + +Describe the technical detail of the change(s). + +If your description starts to get too long, that's a sign that you +probably need to split up your commit to finer grained pieces. +That being said, patches which plainly describe the things that +help reviewers check the patch, and future maintainers understand +the code, are the most beautiful patches. Descriptions that summarise +the point in the subject well, and describe the motivation for the +change, the approach taken by the change, and if relevant how this +differs substantially from the prior version, can be found on Usenet +archives back into the late 80's. Consider it like good Netiquette, +but for code. + +Oh, another thing. I am picky about whitespaces. Make sure your +changes do not trigger errors with the sample pre-commit hook shipped +in templates/hooks--pre-commit. To help ensure this does not happen, +run git diff --check on your changes before you commit. + + +(1a) Try to be nice to older C compilers + +We try to support a wide range of C compilers to compile +git with. That means that you should not use C99 initializers, even +if a lot of compilers grok it. + +Also, variables have to be declared at the beginning of the block +(you can check this with gcc, using the -Wdeclaration-after-statement +option). + +Another thing: NULL pointers shall be written as NULL, not as 0. + + +(2) Generate your patch using git tools out of your commits. + +git based diff tools (git, Cogito, and StGIT included) generate +unidiff which is the preferred format. + +You do not have to be afraid to use -M option to "git diff" or +"git format-patch", if your patch involves file renames. The +receiving end can handle them just fine. + +Please make sure your patch does not include any extra files +which do not belong in a patch submission. Make sure to review +your patch after generating it, to ensure accuracy. Before +sending out, please make sure it cleanly applies to the "master" +branch head. If you are preparing a work based on "next" branch, +that is fine, but please mark it as such. + + +(3) Sending your patches. + +People on the git mailing list need to be able to read and +comment on the changes you are submitting. It is important for +a developer to be able to "quote" your changes, using standard +e-mail tools, so that they may comment on specific portions of +your code. For this reason, all patches should be submitted +"inline". WARNING: Be wary of your MUAs word-wrap +corrupting your patch. Do not cut-n-paste your patch; you can +lose tabs that way if you are not careful. + +It is a common convention to prefix your subject line with +[PATCH]. This lets people easily distinguish patches from other +e-mail discussions. Use of additional markers after PATCH and +the closing bracket to mark the nature of the patch is also +encouraged. E.g. [PATCH/RFC] is often used when the patch is +not ready to be applied but it is for discussion, [PATCH v2], +[PATCH v3] etc. are often seen when you are sending an update to +what you have previously sent. + +"git format-patch" command follows the best current practice to +format the body of an e-mail message. At the beginning of the +patch should come your commit message, ending with the +Signed-off-by: lines, and a line that consists of three dashes, +followed by the diffstat information and the patch itself. If +you are forwarding a patch from somebody else, optionally, at +the beginning of the e-mail message just before the commit +message starts, you can put a "From: " line to name that person. + +You often want to add additional explanation about the patch, +other than the commit message itself. Place such "cover letter" +material between the three dash lines and the diffstat. + +Do not attach the patch as a MIME attachment, compressed or not. +Do not let your e-mail client send quoted-printable. Do not let +your e-mail client send format=flowed which would destroy +whitespaces in your patches. Many +popular e-mail applications will not always transmit a MIME +attachment as plain text, making it impossible to comment on +your code. A MIME attachment also takes a bit more time to +process. This does not decrease the likelihood of your +MIME-attached change being accepted, but it makes it more likely +that it will be postponed. + +Exception: If your mailer is mangling patches then someone may ask +you to re-send them using MIME, that is OK. + +Do not PGP sign your patch, at least for now. Most likely, your +maintainer or other people on the list would not have your PGP +key and would not bother obtaining it anyway. Your patch is not +judged by who you are; a good patch from an unknown origin has a +far better chance of being accepted than a patch from a known, +respected origin that is done poorly or does incorrect things. + +If you really really really really want to do a PGP signed +patch, format it as "multipart/signed", not a text/plain message +that starts with '-----BEGIN PGP SIGNED MESSAGE-----'. That is +not a text/plain, it's something else. + +Unless your patch is a very trivial and an obviously correct one, +first send it with "To:" set to the mailing list, with "cc:" listing +people who are involved in the area you are touching (the output from +"git blame $path" and "git shortlog --no-merges $path" would help to +identify them), to solicit comments and reviews. After the list +reached a consensus that it is a good idea to apply the patch, re-send +it with "To:" set to the maintainer and optionally "cc:" the list for +inclusion. Do not forget to add trailers such as "Acked-by:", +"Reviewed-by:" and "Tested-by:" after your "Signed-off-by:" line as +necessary. + + +(4) Sign your work + +To improve tracking of who did what, we've borrowed the +"sign-off" procedure from the Linux kernel project on patches +that are being emailed around. Although core GIT is a lot +smaller project it is a good discipline to follow it. + +The sign-off is a simple line at the end of the explanation for +the patch, which certifies that you wrote it or otherwise have +the right to pass it on as a open-source patch. The rules are +pretty simple: if you can certify the below: + + Developer's Certificate of Origin 1.1 + + By making a contribution to this project, I certify that: + + (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + + (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + + (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + + (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +then you just add a line saying + + Signed-off-by: Random J Developer + +This line can be automatically added by git if you run the git-commit +command with the -s option. + +Notice that you can place your own Signed-off-by: line when +forwarding somebody else's patch with the above rules for +D-C-O. Indeed you are encouraged to do so. Do not forget to +place an in-body "From: " line at the beginning to properly attribute +the change to its true author (see (2) above). + +Also notice that a real name is used in the Signed-off-by: line. Please +don't hide your real name. + +Some people also put extra tags at the end. + +"Acked-by:" says that the patch was reviewed by the person who +is more familiar with the issues and the area the patch attempts +to modify. "Tested-by:" says the patch was tested by the person +and found to have the desired effect. + +------------------------------------------------ +An ideal patch flow + +Here is an ideal patch flow for this project the current maintainer +suggests to the contributors: + + (0) You come up with an itch. You code it up. + + (1) Send it to the list and cc people who may need to know about + the change. + + The people who may need to know are the ones whose code you + are butchering. These people happen to be the ones who are + most likely to be knowledgeable enough to help you, but + they have no obligation to help you (i.e. you ask for help, + don't demand). "git log -p -- $area_you_are_modifying" would + help you find out who they are. + + (2) You get comments and suggestions for improvements. You may + even get them in a "on top of your change" patch form. + + (3) Polish, refine, and re-send to the list and the people who + spend their time to improve your patch. Go back to step (2). + + (4) The list forms consensus that the last round of your patch is + good. Send it to the list and cc the maintainer. + + (5) A topic branch is created with the patch and is merged to 'next', + and cooked further and eventually graduates to 'master'. + +In any time between the (2)-(3) cycle, the maintainer may pick it up +from the list and queue it to 'pu', in order to make it easier for +people play with it without having to pick up and apply the patch to +their trees themselves. + +------------------------------------------------ +Know the status of your patch after submission + +* You can use Git itself to find out when your patch is merged in + master. 'git pull --rebase' will automatically skip already-applied + patches, and will let you know. This works only if you rebase on top + of the branch in which your patch has been merged (i.e. it will not + tell you if your patch is merged in pu if you rebase on top of + master). + +* Read the git mailing list, the maintainer regularly posts messages + entitled "What's cooking in git.git" and "What's in git.git" giving + the status of various proposed changes. + +------------------------------------------------ +MUA specific hints + +Some of patches I receive or pick up from the list share common +patterns of breakage. Please make sure your MUA is set up +properly not to corrupt whitespaces. Here are two common ones +I have seen: + +* Empty context lines that do not have _any_ whitespace. + +* Non empty context lines that have one extra whitespace at the + beginning. + +One test you could do yourself if your MUA is set up correctly is: + +* Send the patch to yourself, exactly the way you would, except + To: and Cc: lines, which would not contain the list and + maintainer address. + +* Save that patch to a file in UNIX mailbox format. Call it say + a.patch. + +* Try to apply to the tip of the "master" branch from the + git.git public repository: + + $ git fetch http://kernel.org/pub/scm/git/git.git master:test-apply + $ git checkout test-apply + $ git reset --hard + $ git am a.patch + +If it does not apply correctly, there can be various reasons. + +* Your patch itself does not apply cleanly. That is _bad_ but + does not have much to do with your MUA. Please rebase the + patch appropriately. + +* Your MUA corrupted your patch; "am" would complain that + the patch does not apply. Look at .git/rebase-apply/ subdirectory and + see what 'patch' file contains and check for the common + corruption patterns mentioned above. + +* While you are at it, check what are in 'info' and + 'final-commit' files as well. If what is in 'final-commit' is + not exactly what you would want to see in the commit log + message, it is very likely that your maintainer would end up + hand editing the log message when he applies your patch. + Things like "Hi, this is my first patch.\n", if you really + want to put in the patch e-mail, should come after the + three-dash line that signals the end of the commit message. + + +Pine +---- + +(Johannes Schindelin) + +I don't know how many people still use pine, but for those poor +souls it may be good to mention that the quell-flowed-text is +needed for recent versions. + +... the "no-strip-whitespace-before-send" option, too. AFAIK it +was introduced in 4.60. + +(Linus Torvalds) + +And 4.58 needs at least this. + +--- +diff-tree 8326dd8350be64ac7fc805f6563a1d61ad10d32c (from e886a61f76edf5410573e92e38ce22974f9c40f1) +Author: Linus Torvalds +Date: Mon Aug 15 17:23:51 2005 -0700 + + Fix pine whitespace-corruption bug + + There's no excuse for unconditionally removing whitespace from + the pico buffers on close. + +diff --git a/pico/pico.c b/pico/pico.c +--- a/pico/pico.c ++++ b/pico/pico.c +@@ -219,7 +219,9 @@ PICO *pm; + switch(pico_all_done){ /* prepare for/handle final events */ + case COMP_EXIT : /* already confirmed */ + packheader(); ++#if 0 + stripwhitespace(); ++#endif + c |= COMP_EXIT; + break; + + +(Daniel Barkalow) + +> A patch to SubmittingPatches, MUA specific help section for +> users of Pine 4.63 would be very much appreciated. + +Ah, it looks like a recent version changed the default behavior to do the +right thing, and inverted the sense of the configuration option. (Either +that or Gentoo did it.) So you need to set the +"no-strip-whitespace-before-send" option, unless the option you have is +"strip-whitespace-before-send", in which case you should avoid checking +it. + + +Thunderbird +----------- + +(A Large Angry SCM) + +By default, Thunderbird will both wrap emails as well as flag them as +being 'format=flowed', both of which will make the resulting email unusable +by git. + +Here are some hints on how to successfully submit patches inline using +Thunderbird. + +There are two different approaches. One approach is to configure +Thunderbird to not mangle patches. The second approach is to use +an external editor to keep Thunderbird from mangling the patches. + +Approach #1 (configuration): + +This recipe is current as of Thunderbird 2.0.0.19. Three steps: + 1. Configure your mail server composition as plain text + Edit...Account Settings...Composition & Addressing, + uncheck 'Compose Messages in HTML'. + 2. Configure your general composition window to not wrap + Edit..Preferences..Composition, wrap plain text messages at 0 + 3. Disable the use of format=flowed + Edit..Preferences..Advanced..Config Editor. Search for: + mailnews.send_plaintext_flowed + toggle it to make sure it is set to 'false'. + +After that is done, you should be able to compose email as you +otherwise would (cut + paste, git-format-patch | git-imap-send, etc), +and the patches should not be mangled. + +Approach #2 (external editor): + +This recipe appears to work with the current [*1*] Thunderbird from Suse. + +The following Thunderbird extensions are needed: + AboutConfig 0.5 + http://aboutconfig.mozdev.org/ + External Editor 0.7.2 + http://globs.org/articles.php?lng=en&pg=8 + +1) Prepare the patch as a text file using your method of choice. + +2) Before opening a compose window, use Edit->Account Settings to +uncheck the "Compose messages in HTML format" setting in the +"Composition & Addressing" panel of the account to be used to send the +patch. [*2*] + +3) In the main Thunderbird window, _before_ you open the compose window +for the patch, use Tools->about:config to set the following to the +indicated values: + mailnews.send_plaintext_flowed => false + mailnews.wraplength => 0 + +4) Open a compose window and click the external editor icon. + +5) In the external editor window, read in the patch file and exit the +editor normally. + +6) Back in the compose window: Add whatever other text you wish to the +message, complete the addressing and subject fields, and press send. + +7) Optionally, undo the about:config/account settings changes made in +steps 2 & 3. + + +[Footnotes] +*1* Version 1.0 (20041207) from the MozillaThunderbird-1.0-5 rpm of Suse +9.3 professional updates. + +*2* It may be possible to do this with about:config and the following +settings but I haven't tried, yet. + mail.html_compose => false + mail.identity.default.compose_html => false + mail.identity.id?.compose_html => false + +(Lukas Sandström) + +There is a script in contrib/thunderbird-patch-inline which can help +you include patches with Thunderbird in an easy way. To use it, do the +steps above and then use the script as the external editor. + +Gnus +---- + +'|' in the *Summary* buffer can be used to pipe the current +message to an external program, and this is a handy way to drive +"git am". However, if the message is MIME encoded, what is +piped into the program is the representation you see in your +*Article* buffer after unwrapping MIME. This is often not what +you would want for two reasons. It tends to screw up non ASCII +characters (most notably in people's names), and also +whitespaces (fatal in patches). Running 'C-u g' to display the +message in raw form before using '|' to run the pipe can work +this problem around. + + +KMail +----- + +This should help you to submit patches inline using KMail. + +1) Prepare the patch as a text file. + +2) Click on New Mail. + +3) Go under "Options" in the Composer window and be sure that +"Word wrap" is not set. + +4) Use Message -> Insert file... and insert the patch. + +5) Back in the compose window: add whatever other text you wish to the +message, complete the addressing and subject fields, and press send. + + +Gmail +----- + +GMail does not appear to have any way to turn off line wrapping in the web +interface, so this will mangle any emails that you send. You can however +use "git send e-mail" and send your patches through the GMail SMTP server, or +use any IMAP email client to connect to the google IMAP server and forward +the emails through that. + +To use "git send-email" and send your patches through the GMail SMTP server, +edit ~/.gitconfig to specify your account settings: + +[sendemail] + smtpencryption = tls + smtpserver = smtp.gmail.com + smtpuser = user@gmail.com + smtppass = p4ssw0rd + smtpserverport = 587 + +Once your commits are ready to be sent to the mailing list, run the +following commands: + + $ git format-patch --cover-letter -M origin/master -o outgoing/ + $ edit outgoing/0000-* + $ git send-email outgoing/* + +To submit using the IMAP interface, first, edit your ~/.gitconfig to specify your +account settings: + +[imap] + folder = "[Gmail]/Drafts" + host = imaps://imap.gmail.com + user = user@gmail.com + pass = p4ssw0rd + port = 993 + sslverify = false + +You might need to instead use: folder = "[Google Mail]/Drafts" if you get an error +that the "Folder doesn't exist". + +Once your commits are ready to be sent to the mailing list, run the +following commands: + + $ git format-patch --cover-letter -M --stdout origin/master | git imap-send + +Just make sure to disable line wrapping in the email client (GMail web +interface will line wrap no matter what, so you need to use a real +IMAP client). + From d8e868ec1f79a09da9c11a5ec9e751f9326d1925 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 26 May 2010 19:17:47 -0400 Subject: [PATCH 070/140] clean up from git.git to remove git specific elements --- src/SubmittingPatches | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/SubmittingPatches b/src/SubmittingPatches index b9204c7..4963fca 100644 --- a/src/SubmittingPatches +++ b/src/SubmittingPatches @@ -13,13 +13,14 @@ Checklist (and a short version for the impatient): not "changed" or "changes". - includes motivation for the change, and contrasts its implementation with previous behaviour - - if you want your work included in git.git, add a + - if you want your work included in the main repository, add a "Signed-off-by: Your Name " line to the commit message (or just use the option "-s" when committing) to confirm that you agree to the Developer's Certificate of Origin - make sure that you have tests for the bug you are fixing - make sure that the test suite passes after your commit + - make sure that you provide documentation for any features Patch: @@ -37,11 +38,6 @@ Checklist (and a short version for the impatient): documentation should be updated as well. - if your name is not writable in ASCII, make sure that you send off a message in the correct encoding. - - send the patch to the list (git@vger.kernel.org) and the - maintainer (gitster@pobox.com) if (and only if) the patch - is ready for inclusion. If you use git-send-email(1), - please test it first by sending email to yourself. - - see below for instructions specific to your mailer Long version: @@ -142,14 +138,13 @@ that is fine, but please mark it as such. (3) Sending your patches. -People on the git mailing list need to be able to read and -comment on the changes you are submitting. It is important for -a developer to be able to "quote" your changes, using standard -e-mail tools, so that they may comment on specific portions of -your code. For this reason, all patches should be submitted -"inline". WARNING: Be wary of your MUAs word-wrap -corrupting your patch. Do not cut-n-paste your patch; you can -lose tabs that way if you are not careful. +People need to be able to read and comment on the changes you are +submitting. It is important for a developer to be able to "quote" +your changes, using standard e-mail tools, so that they may comment +on specific portions of your code. For this reason, all patches +should be submitted "inline". WARNING: Be wary of your MUAs word-wrap +corrupting your patch. Do not cut-n-paste your patch; you can lose +tabs that way if you are not careful. It is a common convention to prefix your subject line with [PATCH]. This lets people easily distinguish patches from other @@ -280,7 +275,7 @@ suggests to the contributors: (0) You come up with an itch. You code it up. - (1) Send it to the list and cc people who may need to know about + (1) Send it to the bug tracker and cc people who may need to know about the change. The people who may need to know are the ones whose code you @@ -317,10 +312,6 @@ Know the status of your patch after submission tell you if your patch is merged in pu if you rebase on top of master). -* Read the git mailing list, the maintainer regularly posts messages - entitled "What's cooking in git.git" and "What's in git.git" giving - the status of various proposed changes. - ------------------------------------------------ MUA specific hints From 227022b8292cebcc215a96e20c02662045c1753c Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 26 May 2010 19:19:51 -0400 Subject: [PATCH 071/140] add SubmittingPatches --- Changes | 1 + MANIFEST | 1 + SubmittingPatches | 584 ++++++++++++++++++++++++++++++++++++++++++++++ src/Changes | 1 + 4 files changed, 587 insertions(+) create mode 100644 SubmittingPatches diff --git a/Changes b/Changes index 13c7efb..2f2de5a 100644 --- a/Changes +++ b/Changes @@ -4,6 +4,7 @@ Revision history for Template::ShowStartStop * Change License to Artistic 2.0 because dual license isn't required * add basic functionality test * simplify documentation +* add SubmittingPatches documentation 0.07 May 10 2010 ==================================== diff --git a/MANIFEST b/MANIFEST index 22997a5..b91c94d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -4,6 +4,7 @@ MANIFEST META.yml Makefile.PL README +SubmittingPatches lib/Template/ShowStartStop.pm t/00-compile.t t/000-report-versions.t diff --git a/SubmittingPatches b/SubmittingPatches new file mode 100644 index 0000000..4963fca --- /dev/null +++ b/SubmittingPatches @@ -0,0 +1,584 @@ +Checklist (and a short version for the impatient): + + Commits: + + - make commits of logical units + - check for unnecessary whitespace with "git diff --check" + before committing + - do not check in commented out code or unneeded files + - the first line of the commit message should be a short + description and should skip the full stop + - the body should provide a meaningful commit message, which: + - uses the imperative, present tense: "change", + not "changed" or "changes". + - includes motivation for the change, and contrasts + its implementation with previous behaviour + - if you want your work included in the main repository, add a + "Signed-off-by: Your Name " line to the + commit message (or just use the option "-s" when + committing) to confirm that you agree to the Developer's + Certificate of Origin + - make sure that you have tests for the bug you are fixing + - make sure that the test suite passes after your commit + - make sure that you provide documentation for any features + + Patch: + + - use "git format-patch -M" to create the patch + - do not PGP sign your patch + - do not attach your patch, but read in the mail + body, unless you cannot teach your mailer to + leave the formatting of the patch alone. + - be careful doing cut & paste into your mailer, not to + corrupt whitespaces. + - provide additional information (which is unsuitable for + the commit message) between the "---" and the diffstat + - if you change, add, or remove a command line option or + make some other user interface change, the associated + documentation should be updated as well. + - if your name is not writable in ASCII, make sure that + you send off a message in the correct encoding. + +Long version: + +I started reading over the SubmittingPatches document for Linux +kernel, primarily because I wanted to have a document similar to +it for the core GIT to make sure people understand what they are +doing when they write "Signed-off-by" line. + +But the patch submission requirements are a lot more relaxed +here on the technical/contents front, because the core GIT is +thousand times smaller ;-). So here is only the relevant bits. + +(0) Decide what to base your work on. + +In general, always base your work on the oldest branch that your +change is relevant to. + + - A bugfix should be based on 'maint' in general. If the bug is not + present in 'maint', base it on 'master'. For a bug that's not yet + in 'master', find the topic that introduces the regression, and + base your work on the tip of the topic. + + - A new feature should be based on 'master' in general. If the new + feature depends on a topic that is in 'pu', but not in 'master', + base your work on the tip of that topic. + + - Corrections and enhancements to a topic not yet in 'master' should + be based on the tip of that topic. If the topic has not been merged + to 'next', it's alright to add a note to squash minor corrections + into the series. + + - In the exceptional case that a new feature depends on several topics + not in 'master', start working on 'next' or 'pu' privately and send + out patches for discussion. Before the final merge, you may have to + wait until some of the dependent topics graduate to 'master', and + rebase your work. + +To find the tip of a topic branch, run "git log --first-parent +master..pu" and look for the merge commit. The second parent of this +commit is the tip of the topic branch. + +(1) Make separate commits for logically separate changes. + +Unless your patch is really trivial, you should not be sending +out a patch that was generated between your working tree and +your commit head. Instead, always make a commit with complete +commit message and generate a series of patches from your +repository. It is a good discipline. + +Describe the technical detail of the change(s). + +If your description starts to get too long, that's a sign that you +probably need to split up your commit to finer grained pieces. +That being said, patches which plainly describe the things that +help reviewers check the patch, and future maintainers understand +the code, are the most beautiful patches. Descriptions that summarise +the point in the subject well, and describe the motivation for the +change, the approach taken by the change, and if relevant how this +differs substantially from the prior version, can be found on Usenet +archives back into the late 80's. Consider it like good Netiquette, +but for code. + +Oh, another thing. I am picky about whitespaces. Make sure your +changes do not trigger errors with the sample pre-commit hook shipped +in templates/hooks--pre-commit. To help ensure this does not happen, +run git diff --check on your changes before you commit. + + +(1a) Try to be nice to older C compilers + +We try to support a wide range of C compilers to compile +git with. That means that you should not use C99 initializers, even +if a lot of compilers grok it. + +Also, variables have to be declared at the beginning of the block +(you can check this with gcc, using the -Wdeclaration-after-statement +option). + +Another thing: NULL pointers shall be written as NULL, not as 0. + + +(2) Generate your patch using git tools out of your commits. + +git based diff tools (git, Cogito, and StGIT included) generate +unidiff which is the preferred format. + +You do not have to be afraid to use -M option to "git diff" or +"git format-patch", if your patch involves file renames. The +receiving end can handle them just fine. + +Please make sure your patch does not include any extra files +which do not belong in a patch submission. Make sure to review +your patch after generating it, to ensure accuracy. Before +sending out, please make sure it cleanly applies to the "master" +branch head. If you are preparing a work based on "next" branch, +that is fine, but please mark it as such. + + +(3) Sending your patches. + +People need to be able to read and comment on the changes you are +submitting. It is important for a developer to be able to "quote" +your changes, using standard e-mail tools, so that they may comment +on specific portions of your code. For this reason, all patches +should be submitted "inline". WARNING: Be wary of your MUAs word-wrap +corrupting your patch. Do not cut-n-paste your patch; you can lose +tabs that way if you are not careful. + +It is a common convention to prefix your subject line with +[PATCH]. This lets people easily distinguish patches from other +e-mail discussions. Use of additional markers after PATCH and +the closing bracket to mark the nature of the patch is also +encouraged. E.g. [PATCH/RFC] is often used when the patch is +not ready to be applied but it is for discussion, [PATCH v2], +[PATCH v3] etc. are often seen when you are sending an update to +what you have previously sent. + +"git format-patch" command follows the best current practice to +format the body of an e-mail message. At the beginning of the +patch should come your commit message, ending with the +Signed-off-by: lines, and a line that consists of three dashes, +followed by the diffstat information and the patch itself. If +you are forwarding a patch from somebody else, optionally, at +the beginning of the e-mail message just before the commit +message starts, you can put a "From: " line to name that person. + +You often want to add additional explanation about the patch, +other than the commit message itself. Place such "cover letter" +material between the three dash lines and the diffstat. + +Do not attach the patch as a MIME attachment, compressed or not. +Do not let your e-mail client send quoted-printable. Do not let +your e-mail client send format=flowed which would destroy +whitespaces in your patches. Many +popular e-mail applications will not always transmit a MIME +attachment as plain text, making it impossible to comment on +your code. A MIME attachment also takes a bit more time to +process. This does not decrease the likelihood of your +MIME-attached change being accepted, but it makes it more likely +that it will be postponed. + +Exception: If your mailer is mangling patches then someone may ask +you to re-send them using MIME, that is OK. + +Do not PGP sign your patch, at least for now. Most likely, your +maintainer or other people on the list would not have your PGP +key and would not bother obtaining it anyway. Your patch is not +judged by who you are; a good patch from an unknown origin has a +far better chance of being accepted than a patch from a known, +respected origin that is done poorly or does incorrect things. + +If you really really really really want to do a PGP signed +patch, format it as "multipart/signed", not a text/plain message +that starts with '-----BEGIN PGP SIGNED MESSAGE-----'. That is +not a text/plain, it's something else. + +Unless your patch is a very trivial and an obviously correct one, +first send it with "To:" set to the mailing list, with "cc:" listing +people who are involved in the area you are touching (the output from +"git blame $path" and "git shortlog --no-merges $path" would help to +identify them), to solicit comments and reviews. After the list +reached a consensus that it is a good idea to apply the patch, re-send +it with "To:" set to the maintainer and optionally "cc:" the list for +inclusion. Do not forget to add trailers such as "Acked-by:", +"Reviewed-by:" and "Tested-by:" after your "Signed-off-by:" line as +necessary. + + +(4) Sign your work + +To improve tracking of who did what, we've borrowed the +"sign-off" procedure from the Linux kernel project on patches +that are being emailed around. Although core GIT is a lot +smaller project it is a good discipline to follow it. + +The sign-off is a simple line at the end of the explanation for +the patch, which certifies that you wrote it or otherwise have +the right to pass it on as a open-source patch. The rules are +pretty simple: if you can certify the below: + + Developer's Certificate of Origin 1.1 + + By making a contribution to this project, I certify that: + + (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + + (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + + (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + + (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +then you just add a line saying + + Signed-off-by: Random J Developer + +This line can be automatically added by git if you run the git-commit +command with the -s option. + +Notice that you can place your own Signed-off-by: line when +forwarding somebody else's patch with the above rules for +D-C-O. Indeed you are encouraged to do so. Do not forget to +place an in-body "From: " line at the beginning to properly attribute +the change to its true author (see (2) above). + +Also notice that a real name is used in the Signed-off-by: line. Please +don't hide your real name. + +Some people also put extra tags at the end. + +"Acked-by:" says that the patch was reviewed by the person who +is more familiar with the issues and the area the patch attempts +to modify. "Tested-by:" says the patch was tested by the person +and found to have the desired effect. + +------------------------------------------------ +An ideal patch flow + +Here is an ideal patch flow for this project the current maintainer +suggests to the contributors: + + (0) You come up with an itch. You code it up. + + (1) Send it to the bug tracker and cc people who may need to know about + the change. + + The people who may need to know are the ones whose code you + are butchering. These people happen to be the ones who are + most likely to be knowledgeable enough to help you, but + they have no obligation to help you (i.e. you ask for help, + don't demand). "git log -p -- $area_you_are_modifying" would + help you find out who they are. + + (2) You get comments and suggestions for improvements. You may + even get them in a "on top of your change" patch form. + + (3) Polish, refine, and re-send to the list and the people who + spend their time to improve your patch. Go back to step (2). + + (4) The list forms consensus that the last round of your patch is + good. Send it to the list and cc the maintainer. + + (5) A topic branch is created with the patch and is merged to 'next', + and cooked further and eventually graduates to 'master'. + +In any time between the (2)-(3) cycle, the maintainer may pick it up +from the list and queue it to 'pu', in order to make it easier for +people play with it without having to pick up and apply the patch to +their trees themselves. + +------------------------------------------------ +Know the status of your patch after submission + +* You can use Git itself to find out when your patch is merged in + master. 'git pull --rebase' will automatically skip already-applied + patches, and will let you know. This works only if you rebase on top + of the branch in which your patch has been merged (i.e. it will not + tell you if your patch is merged in pu if you rebase on top of + master). + +------------------------------------------------ +MUA specific hints + +Some of patches I receive or pick up from the list share common +patterns of breakage. Please make sure your MUA is set up +properly not to corrupt whitespaces. Here are two common ones +I have seen: + +* Empty context lines that do not have _any_ whitespace. + +* Non empty context lines that have one extra whitespace at the + beginning. + +One test you could do yourself if your MUA is set up correctly is: + +* Send the patch to yourself, exactly the way you would, except + To: and Cc: lines, which would not contain the list and + maintainer address. + +* Save that patch to a file in UNIX mailbox format. Call it say + a.patch. + +* Try to apply to the tip of the "master" branch from the + git.git public repository: + + $ git fetch http://kernel.org/pub/scm/git/git.git master:test-apply + $ git checkout test-apply + $ git reset --hard + $ git am a.patch + +If it does not apply correctly, there can be various reasons. + +* Your patch itself does not apply cleanly. That is _bad_ but + does not have much to do with your MUA. Please rebase the + patch appropriately. + +* Your MUA corrupted your patch; "am" would complain that + the patch does not apply. Look at .git/rebase-apply/ subdirectory and + see what 'patch' file contains and check for the common + corruption patterns mentioned above. + +* While you are at it, check what are in 'info' and + 'final-commit' files as well. If what is in 'final-commit' is + not exactly what you would want to see in the commit log + message, it is very likely that your maintainer would end up + hand editing the log message when he applies your patch. + Things like "Hi, this is my first patch.\n", if you really + want to put in the patch e-mail, should come after the + three-dash line that signals the end of the commit message. + + +Pine +---- + +(Johannes Schindelin) + +I don't know how many people still use pine, but for those poor +souls it may be good to mention that the quell-flowed-text is +needed for recent versions. + +... the "no-strip-whitespace-before-send" option, too. AFAIK it +was introduced in 4.60. + +(Linus Torvalds) + +And 4.58 needs at least this. + +--- +diff-tree 8326dd8350be64ac7fc805f6563a1d61ad10d32c (from e886a61f76edf5410573e92e38ce22974f9c40f1) +Author: Linus Torvalds +Date: Mon Aug 15 17:23:51 2005 -0700 + + Fix pine whitespace-corruption bug + + There's no excuse for unconditionally removing whitespace from + the pico buffers on close. + +diff --git a/pico/pico.c b/pico/pico.c +--- a/pico/pico.c ++++ b/pico/pico.c +@@ -219,7 +219,9 @@ PICO *pm; + switch(pico_all_done){ /* prepare for/handle final events */ + case COMP_EXIT : /* already confirmed */ + packheader(); ++#if 0 + stripwhitespace(); ++#endif + c |= COMP_EXIT; + break; + + +(Daniel Barkalow) + +> A patch to SubmittingPatches, MUA specific help section for +> users of Pine 4.63 would be very much appreciated. + +Ah, it looks like a recent version changed the default behavior to do the +right thing, and inverted the sense of the configuration option. (Either +that or Gentoo did it.) So you need to set the +"no-strip-whitespace-before-send" option, unless the option you have is +"strip-whitespace-before-send", in which case you should avoid checking +it. + + +Thunderbird +----------- + +(A Large Angry SCM) + +By default, Thunderbird will both wrap emails as well as flag them as +being 'format=flowed', both of which will make the resulting email unusable +by git. + +Here are some hints on how to successfully submit patches inline using +Thunderbird. + +There are two different approaches. One approach is to configure +Thunderbird to not mangle patches. The second approach is to use +an external editor to keep Thunderbird from mangling the patches. + +Approach #1 (configuration): + +This recipe is current as of Thunderbird 2.0.0.19. Three steps: + 1. Configure your mail server composition as plain text + Edit...Account Settings...Composition & Addressing, + uncheck 'Compose Messages in HTML'. + 2. Configure your general composition window to not wrap + Edit..Preferences..Composition, wrap plain text messages at 0 + 3. Disable the use of format=flowed + Edit..Preferences..Advanced..Config Editor. Search for: + mailnews.send_plaintext_flowed + toggle it to make sure it is set to 'false'. + +After that is done, you should be able to compose email as you +otherwise would (cut + paste, git-format-patch | git-imap-send, etc), +and the patches should not be mangled. + +Approach #2 (external editor): + +This recipe appears to work with the current [*1*] Thunderbird from Suse. + +The following Thunderbird extensions are needed: + AboutConfig 0.5 + http://aboutconfig.mozdev.org/ + External Editor 0.7.2 + http://globs.org/articles.php?lng=en&pg=8 + +1) Prepare the patch as a text file using your method of choice. + +2) Before opening a compose window, use Edit->Account Settings to +uncheck the "Compose messages in HTML format" setting in the +"Composition & Addressing" panel of the account to be used to send the +patch. [*2*] + +3) In the main Thunderbird window, _before_ you open the compose window +for the patch, use Tools->about:config to set the following to the +indicated values: + mailnews.send_plaintext_flowed => false + mailnews.wraplength => 0 + +4) Open a compose window and click the external editor icon. + +5) In the external editor window, read in the patch file and exit the +editor normally. + +6) Back in the compose window: Add whatever other text you wish to the +message, complete the addressing and subject fields, and press send. + +7) Optionally, undo the about:config/account settings changes made in +steps 2 & 3. + + +[Footnotes] +*1* Version 1.0 (20041207) from the MozillaThunderbird-1.0-5 rpm of Suse +9.3 professional updates. + +*2* It may be possible to do this with about:config and the following +settings but I haven't tried, yet. + mail.html_compose => false + mail.identity.default.compose_html => false + mail.identity.id?.compose_html => false + +(Lukas Sandström) + +There is a script in contrib/thunderbird-patch-inline which can help +you include patches with Thunderbird in an easy way. To use it, do the +steps above and then use the script as the external editor. + +Gnus +---- + +'|' in the *Summary* buffer can be used to pipe the current +message to an external program, and this is a handy way to drive +"git am". However, if the message is MIME encoded, what is +piped into the program is the representation you see in your +*Article* buffer after unwrapping MIME. This is often not what +you would want for two reasons. It tends to screw up non ASCII +characters (most notably in people's names), and also +whitespaces (fatal in patches). Running 'C-u g' to display the +message in raw form before using '|' to run the pipe can work +this problem around. + + +KMail +----- + +This should help you to submit patches inline using KMail. + +1) Prepare the patch as a text file. + +2) Click on New Mail. + +3) Go under "Options" in the Composer window and be sure that +"Word wrap" is not set. + +4) Use Message -> Insert file... and insert the patch. + +5) Back in the compose window: add whatever other text you wish to the +message, complete the addressing and subject fields, and press send. + + +Gmail +----- + +GMail does not appear to have any way to turn off line wrapping in the web +interface, so this will mangle any emails that you send. You can however +use "git send e-mail" and send your patches through the GMail SMTP server, or +use any IMAP email client to connect to the google IMAP server and forward +the emails through that. + +To use "git send-email" and send your patches through the GMail SMTP server, +edit ~/.gitconfig to specify your account settings: + +[sendemail] + smtpencryption = tls + smtpserver = smtp.gmail.com + smtpuser = user@gmail.com + smtppass = p4ssw0rd + smtpserverport = 587 + +Once your commits are ready to be sent to the mailing list, run the +following commands: + + $ git format-patch --cover-letter -M origin/master -o outgoing/ + $ edit outgoing/0000-* + $ git send-email outgoing/* + +To submit using the IMAP interface, first, edit your ~/.gitconfig to specify your +account settings: + +[imap] + folder = "[Gmail]/Drafts" + host = imaps://imap.gmail.com + user = user@gmail.com + pass = p4ssw0rd + port = 993 + sslverify = false + +You might need to instead use: folder = "[Google Mail]/Drafts" if you get an error +that the "Folder doesn't exist". + +Once your commits are ready to be sent to the mailing list, run the +following commands: + + $ git format-patch --cover-letter -M --stdout origin/master | git imap-send + +Just make sure to disable line wrapping in the email client (GMail web +interface will line wrap no matter what, so you need to use a real +IMAP client). + diff --git a/src/Changes b/src/Changes index 2d0043c..a9f8293 100644 --- a/src/Changes +++ b/src/Changes @@ -4,6 +4,7 @@ Revision history for Template::ShowStartStop * Change License to Artistic 2.0 because dual license isn't required * add basic functionality test * simplify documentation +* add SubmittingPatches documentation 0.07 May 10 2010 ==================================== From 3dba474cc09b3a0b6874c3c46cb6d482a1f60aaa Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 26 May 2010 20:26:39 -0400 Subject: [PATCH 072/140] add MetaTests --- Changes | 1 + MANIFEST | 1 + dist.ini | 1 + src/Changes | 1 + t/release-distmeta.t | 15 +++++++++++++++ 5 files changed, 19 insertions(+) create mode 100644 t/release-distmeta.t diff --git a/Changes b/Changes index 2f2de5a..93a30e6 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,7 @@ Revision history for Template::ShowStartStop * add basic functionality test * simplify documentation * add SubmittingPatches documentation +* add MetaTests 0.07 May 10 2010 ==================================== diff --git a/MANIFEST b/MANIFEST index b91c94d..631c982 100644 --- a/MANIFEST +++ b/MANIFEST @@ -10,6 +10,7 @@ t/00-compile.t t/000-report-versions.t t/basic.t t/eval.t +t/release-distmeta.t t/release-minimum-version.t t/release-pod-coverage.t t/release-pod-syntax.t diff --git a/dist.ini b/dist.ini index fd380dc..f41ea8c 100644 --- a/dist.ini +++ b/dist.ini @@ -32,6 +32,7 @@ remove = Readme [ReportVersions] [CompileTests] [MinimumVersionTests] +[MetaTests] [@Git] push_to = my diff --git a/src/Changes b/src/Changes index a9f8293..4df00b4 100644 --- a/src/Changes +++ b/src/Changes @@ -5,6 +5,7 @@ Revision history for Template::ShowStartStop * add basic functionality test * simplify documentation * add SubmittingPatches documentation +* add MetaTests 0.07 May 10 2010 ==================================== diff --git a/t/release-distmeta.t b/t/release-distmeta.t new file mode 100644 index 0000000..503f951 --- /dev/null +++ b/t/release-distmeta.t @@ -0,0 +1,15 @@ +#!perl + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + + +use Test::More; + +eval "use Test::CPAN::Meta"; +plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@; +meta_yaml_ok(); \ No newline at end of file From 6b188694d8b02fa51e9af48bee17a9cbc4a9e923 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 26 May 2010 20:55:41 -0400 Subject: [PATCH 073/140] migrate generated files to another branch --- Changes | 2 +- LICENSE | 207 ----------- MANIFEST | 17 - META.yml | 26 -- Makefile.PL | 59 --- README | 48 --- dist.ini | 6 +- lib/Template/ShowStartStop.pm | 33 +- src/Changes | 38 -- src/SubmittingPatches | 584 ------------------------------ src/lib/Template/ShowStartStop.pm | 92 ----- src/t/basic.t | 32 -- src/t/eval.t | 26 -- t/00-compile.t | 44 --- t/000-report-versions.t | 444 ----------------------- t/release-distmeta.t | 15 - t/release-minimum-version.t | 16 - t/release-pod-coverage.t | 21 -- t/release-pod-syntax.t | 15 - t/release-synopsis.t | 16 - 20 files changed, 5 insertions(+), 1736 deletions(-) delete mode 100644 LICENSE delete mode 100644 MANIFEST delete mode 100644 META.yml delete mode 100644 Makefile.PL delete mode 100644 README delete mode 100644 src/Changes delete mode 100644 src/SubmittingPatches delete mode 100644 src/lib/Template/ShowStartStop.pm delete mode 100644 src/t/basic.t delete mode 100644 src/t/eval.t delete mode 100644 t/00-compile.t delete mode 100644 t/000-report-versions.t delete mode 100644 t/release-distmeta.t delete mode 100644 t/release-minimum-version.t delete mode 100644 t/release-pod-coverage.t delete mode 100644 t/release-pod-syntax.t delete mode 100644 t/release-synopsis.t diff --git a/Changes b/Changes index 93a30e6..4df00b4 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,5 @@ Revision history for Template::ShowStartStop -0.08 May 26 2010 +{{$NEXT}} ==================================== * Change License to Artistic 2.0 because dual license isn't required * add basic functionality test diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 59c9cd3..0000000 --- a/LICENSE +++ /dev/null @@ -1,207 +0,0 @@ -This software is Copyright (c) 2010 by Caleb Cushing. - -This is free software, licensed under: - - The Artistic License 2.0 - - The Artistic License 2.0 - - Copyright (c) 2000-2006, The Perl Foundation. - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -Preamble - -This license establishes the terms under which a given free software -Package may be copied, modified, distributed, and/or redistributed. -The intent is that the Copyright Holder maintains some artistic -control over the development of that Package while still keeping the -Package available as open source and free software. - -You are always permitted to make arrangements wholly outside of this -license directly with the Copyright Holder of a given Package. If the -terms of this license do not permit the full use that you propose to -make of the Package, you should contact the Copyright Holder and seek -a different licensing arrangement. - -Definitions - - "Copyright Holder" means the individual(s) or organization(s) - named in the copyright notice for the entire Package. - - "Contributor" means any party that has contributed code or other - material to the Package, in accordance with the Copyright Holder's - procedures. - - "You" and "your" means any person who would like to copy, - distribute, or modify the Package. - - "Package" means the collection of files distributed by the - Copyright Holder, and derivatives of that collection and/or of - those files. A given Package may consist of either the Standard - Version, or a Modified Version. - - "Distribute" means providing a copy of the Package or making it - accessible to anyone else, or in the case of a company or - organization, to others outside of your company or organization. - - "Distributor Fee" means any fee that you charge for Distributing - this Package or providing support for this Package to another - party. It does not mean licensing fees. - - "Standard Version" refers to the Package if it has not been - modified, or has been modified only in ways explicitly requested - by the Copyright Holder. - - "Modified Version" means the Package, if it has been changed, and - such changes were not explicitly requested by the Copyright - Holder. - - "Original License" means this Artistic License as Distributed with - the Standard Version of the Package, in its current version or as - it may be modified by The Perl Foundation in the future. - - "Source" form means the source code, documentation source, and - configuration files for the Package. - - "Compiled" form means the compiled bytecode, object code, binary, - or any other form resulting from mechanical transformation or - translation of the Source form. - - -Permission for Use and Modification Without Distribution - -(1) You are permitted to use the Standard Version and create and use -Modified Versions for any purpose without restriction, provided that -you do not Distribute the Modified Version. - - -Permissions for Redistribution of the Standard Version - -(2) You may Distribute verbatim copies of the Source form of the -Standard Version of this Package in any medium without restriction, -either gratis or for a Distributor Fee, provided that you duplicate -all of the original copyright notices and associated disclaimers. At -your discretion, such verbatim copies may or may not include a -Compiled form of the Package. - -(3) You may apply any bug fixes, portability changes, and other -modifications made available from the Copyright Holder. The resulting -Package will still be considered the Standard Version, and as such -will be subject to the Original License. - - -Distribution of Modified Versions of the Package as Source - -(4) You may Distribute your Modified Version as Source (either gratis -or for a Distributor Fee, and with or without a Compiled form of the -Modified Version) provided that you clearly document how it differs -from the Standard Version, including, but not limited to, documenting -any non-standard features, executables, or modules, and provided that -you do at least ONE of the following: - - (a) make the Modified Version available to the Copyright Holder - of the Standard Version, under the Original License, so that the - Copyright Holder may include your modifications in the Standard - Version. - - (b) ensure that installation of your Modified Version does not - prevent the user installing or running the Standard Version. In - addition, the Modified Version must bear a name that is different - from the name of the Standard Version. - - (c) allow anyone who receives a copy of the Modified Version to - make the Source form of the Modified Version available to others - under - - (i) the Original License or - - (ii) a license that permits the licensee to freely copy, - modify and redistribute the Modified Version using the same - licensing terms that apply to the copy that the licensee - received, and requires that the Source form of the Modified - Version, and of any works derived from it, be made freely - available in that license fees are prohibited but Distributor - Fees are allowed. - - -Distribution of Compiled Forms of the Standard Version -or Modified Versions without the Source - -(5) You may Distribute Compiled forms of the Standard Version without -the Source, provided that you include complete instructions on how to -get the Source of the Standard Version. Such instructions must be -valid at the time of your distribution. If these instructions, at any -time while you are carrying out such distribution, become invalid, you -must provide new instructions on demand or cease further distribution. -If you provide valid instructions or cease distribution within thirty -days after you become aware that the instructions are invalid, then -you do not forfeit any of your rights under this license. - -(6) You may Distribute a Modified Version in Compiled form without -the Source, provided that you comply with Section 4 with respect to -the Source of the Modified Version. - - -Aggregating or Linking the Package - -(7) You may aggregate the Package (either the Standard Version or -Modified Version) with other packages and Distribute the resulting -aggregation provided that you do not charge a licensing fee for the -Package. Distributor Fees are permitted, and licensing fees for other -components in the aggregation are permitted. The terms of this license -apply to the use and Distribution of the Standard or Modified Versions -as included in the aggregation. - -(8) You are permitted to link Modified and Standard Versions with -other works, to embed the Package in a larger work of your own, or to -build stand-alone binary or bytecode versions of applications that -include the Package, and Distribute the result without restriction, -provided the result does not expose a direct interface to the Package. - - -Items That are Not Considered Part of a Modified Version - -(9) Works (including, but not limited to, modules and scripts) that -merely extend or make use of the Package, do not, by themselves, cause -the Package to be a Modified Version. In addition, such works are not -considered parts of the Package itself, and are not subject to the -terms of this license. - - -General Provisions - -(10) Any use, modification, and distribution of the Standard or -Modified Versions is governed by this Artistic License. By using, -modifying or distributing the Package, you accept this license. Do not -use, modify, or distribute the Package, if you do not accept this -license. - -(11) If your Modified Version has been derived from a Modified -Version made by someone other than you, you are nevertheless required -to ensure that your Modified Version complies with the requirements of -this license. - -(12) This license does not grant you the right to use any trademark, -service mark, tradename, or logo of the Copyright Holder. - -(13) This license includes the non-exclusive, worldwide, -free-of-charge patent license to make, have made, use, offer to sell, -sell, import and otherwise transfer the Package with respect to any -patent claims licensable by the Copyright Holder that are necessarily -infringed by the Package. If you institute patent litigation -(including a cross-claim or counterclaim) against any party alleging -that the Package constitutes direct or contributory patent -infringement, then this Artistic License to you shall terminate on the -date that such litigation is filed. - -(14) Disclaimer of Warranty: -THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS -IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR -NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL -LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/MANIFEST b/MANIFEST deleted file mode 100644 index 631c982..0000000 --- a/MANIFEST +++ /dev/null @@ -1,17 +0,0 @@ -Changes -LICENSE -MANIFEST -META.yml -Makefile.PL -README -SubmittingPatches -lib/Template/ShowStartStop.pm -t/00-compile.t -t/000-report-versions.t -t/basic.t -t/eval.t -t/release-distmeta.t -t/release-minimum-version.t -t/release-pod-coverage.t -t/release-pod-syntax.t -t/release-synopsis.t diff --git a/META.yml b/META.yml deleted file mode 100644 index 8e732d5..0000000 --- a/META.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -abstract: "Display where template's start and stop" -author: - - 'Caleb Cushing ' -build_requires: - Carp: 0 - File::Find: 0 - File::Temp: 0 - Scalar::Util: 0 - Test::More: 0.94 - perl: 5.004 -configure_requires: - ExtUtils::MakeMaker: 6.31 -dynamic_config: 0 -generated_by: 'Dist::Zilla version 3.101450, CPAN::Meta::Converter version 2.101450' -license: artistic2 -meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 -name: Template-ShowStartStop -requires: - Template::Context: 0 - parent: 0 -resources: - repository: http://github.com/xenoterracide/Template-ShowStartStop -version: 0.08 diff --git a/Makefile.PL b/Makefile.PL deleted file mode 100644 index 9cabe89..0000000 --- a/Makefile.PL +++ /dev/null @@ -1,59 +0,0 @@ - -use strict; -use warnings; - - - -use ExtUtils::MakeMaker 6.31; - - - -my %WriteMakefileArgs = ( - 'ABSTRACT' => 'Display where template\'s start and stop', - 'AUTHOR' => 'Caleb Cushing ', - 'BUILD_REQUIRES' => { - 'Carp' => '0', - 'File::Find' => '0', - 'File::Temp' => '0', - 'Scalar::Util' => '0', - 'Test::More' => '0.94', - 'perl' => '5.004' - }, - 'CONFIGURE_REQUIRES' => { - 'ExtUtils::MakeMaker' => '6.31' - }, - 'DISTNAME' => 'Template-ShowStartStop', - 'EXE_FILES' => [], - 'LICENSE' => 'artistic_2', - 'NAME' => 'Template::ShowStartStop', - 'PREREQ_PM' => { - 'Template::Context' => '0', - 'parent' => '0' - }, - 'VERSION' => '0.08', - 'test' => { - 'TESTS' => 't/*.t' - } -); - - -unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { - my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; - my $pp = $WriteMakefileArgs{PREREQ_PM}; - for my $mod ( keys %$br ) { - if ( exists $pp->{$mod} ) { - $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; - } - else { - $pp->{$mod} = $br->{$mod}; - } - } -} - -delete $WriteMakefileArgs{CONFIGURE_REQUIRES} - unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; - -WriteMakefile(%WriteMakefileArgs); - - - diff --git a/README b/README deleted file mode 100644 index 05f4cab..0000000 --- a/README +++ /dev/null @@ -1,48 +0,0 @@ -NAME - Template::ShowStartStop - Display where template's start and stop - -VERSION - version 0.08 - -SYNOPSIS - use Template::ShowStartStop; - - my $tt = Template->new({ - CONTEXT => Template::ShowStartStop->new - }); - -DESCRIPTION - Template::ShowStartStop provides inline comments througout your code - where each template stops and starts. It's an overridden version of - Template::Context that wraps the "process()" method. - - Using Template::ShowStartStop is simple. Now when you process templates, - HTML comments will get embedded in your output, which you can easily - grep for. The nesting level is also shown. - - - - - .... - - - -BUGS - Please report any bugs or feature requests on - as I'm - not fond of RT. - -ACKNOWLEDGEMENTS - Thanks to Andy Lester, Randal Schwartz, Bill Moseley, and to Gavin Estey - for the original Template::Timer code that this is based on. - -AUTHOR - Caleb Cushing - -COPYRIGHT AND LICENSE - This software is Copyright (c) 2010 by Caleb Cushing. - - This is free software, licensed under: - - The Artistic License 2.0 - diff --git a/dist.ini b/dist.ini index f41ea8c..028b759 100644 --- a/dist.ini +++ b/dist.ini @@ -12,10 +12,6 @@ remove = GatherDir remove = Readme [GatherDir] - root = src -[CopyTo] - dir = . - [AutoPrereq] [PkgVersion] @@ -37,3 +33,5 @@ remove = Readme [@Git] push_to = my tag_format = %v + +[Git::CommitBuild] diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index 614bd19..da2b5ff 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -1,7 +1,4 @@ package Template::ShowStartStop; -BEGIN { - $Template::ShowStartStop::VERSION = '0.08'; -} use strict; use warnings; use parent qw( Template::Context ); @@ -35,18 +32,8 @@ my $wrapped = sub { { no strict 'refs'; *{$sub} = $wrapped; } 1; - - -=pod - -=head1 NAME - -Template::ShowStartStop - Display where template's start and stop - -=head1 VERSION - -version 0.08 - +__END__ +# ABSTRACT: Display where template's start and stop =head1 SYNOPSIS use Template::ShowStartStop; @@ -86,24 +73,8 @@ Randal Schwartz, Bill Moseley, and to Gavin Estey for the original Template::Timer code that this is based on. -=head1 AUTHOR - - Caleb Cushing - -=head1 COPYRIGHT AND LICENSE - -This software is Copyright (c) 2010 by Caleb Cushing. - -This is free software, licensed under: - - The Artistic License 2.0 - =cut - -__END__ -# ABSTRACT: Display where template's start and stop - # notes from an IRC conversation on how to improve this module [Tuesday 02 March 2010] [04:26:51 pm] xenoterracide: you can get rid of foreach, since you only wrap one method, also drop my $super = ...;, remove diff --git a/src/Changes b/src/Changes deleted file mode 100644 index 4df00b4..0000000 --- a/src/Changes +++ /dev/null @@ -1,38 +0,0 @@ -Revision history for Template::ShowStartStop -{{$NEXT}} -==================================== -* Change License to Artistic 2.0 because dual license isn't required -* add basic functionality test -* simplify documentation -* add SubmittingPatches documentation -* add MetaTests - -0.07 May 10 2010 -==================================== -Fix Licensing Issues - -0.06 May 10 2010 -==================================== -Migrate completely to Dist::Zilla - -0.05 Apr 26 2010 -==================================== -change back to ternary. -remove foreach. -use Dist::Zilla for packaging - -0.04 Mar 1 2010 -==================================== -change from heredoc. I think it's sloppy - -0.03 Feb 15 2010 -==================================== -Clean up files for wrong comments - -0.02 Jan 26 2010 -==================================== -Show process only comments to remove redunancy - -0.01 Jan 25 2010 -==================================== -First rudimentary version. Patches and comments welcome. diff --git a/src/SubmittingPatches b/src/SubmittingPatches deleted file mode 100644 index 4963fca..0000000 --- a/src/SubmittingPatches +++ /dev/null @@ -1,584 +0,0 @@ -Checklist (and a short version for the impatient): - - Commits: - - - make commits of logical units - - check for unnecessary whitespace with "git diff --check" - before committing - - do not check in commented out code or unneeded files - - the first line of the commit message should be a short - description and should skip the full stop - - the body should provide a meaningful commit message, which: - - uses the imperative, present tense: "change", - not "changed" or "changes". - - includes motivation for the change, and contrasts - its implementation with previous behaviour - - if you want your work included in the main repository, add a - "Signed-off-by: Your Name " line to the - commit message (or just use the option "-s" when - committing) to confirm that you agree to the Developer's - Certificate of Origin - - make sure that you have tests for the bug you are fixing - - make sure that the test suite passes after your commit - - make sure that you provide documentation for any features - - Patch: - - - use "git format-patch -M" to create the patch - - do not PGP sign your patch - - do not attach your patch, but read in the mail - body, unless you cannot teach your mailer to - leave the formatting of the patch alone. - - be careful doing cut & paste into your mailer, not to - corrupt whitespaces. - - provide additional information (which is unsuitable for - the commit message) between the "---" and the diffstat - - if you change, add, or remove a command line option or - make some other user interface change, the associated - documentation should be updated as well. - - if your name is not writable in ASCII, make sure that - you send off a message in the correct encoding. - -Long version: - -I started reading over the SubmittingPatches document for Linux -kernel, primarily because I wanted to have a document similar to -it for the core GIT to make sure people understand what they are -doing when they write "Signed-off-by" line. - -But the patch submission requirements are a lot more relaxed -here on the technical/contents front, because the core GIT is -thousand times smaller ;-). So here is only the relevant bits. - -(0) Decide what to base your work on. - -In general, always base your work on the oldest branch that your -change is relevant to. - - - A bugfix should be based on 'maint' in general. If the bug is not - present in 'maint', base it on 'master'. For a bug that's not yet - in 'master', find the topic that introduces the regression, and - base your work on the tip of the topic. - - - A new feature should be based on 'master' in general. If the new - feature depends on a topic that is in 'pu', but not in 'master', - base your work on the tip of that topic. - - - Corrections and enhancements to a topic not yet in 'master' should - be based on the tip of that topic. If the topic has not been merged - to 'next', it's alright to add a note to squash minor corrections - into the series. - - - In the exceptional case that a new feature depends on several topics - not in 'master', start working on 'next' or 'pu' privately and send - out patches for discussion. Before the final merge, you may have to - wait until some of the dependent topics graduate to 'master', and - rebase your work. - -To find the tip of a topic branch, run "git log --first-parent -master..pu" and look for the merge commit. The second parent of this -commit is the tip of the topic branch. - -(1) Make separate commits for logically separate changes. - -Unless your patch is really trivial, you should not be sending -out a patch that was generated between your working tree and -your commit head. Instead, always make a commit with complete -commit message and generate a series of patches from your -repository. It is a good discipline. - -Describe the technical detail of the change(s). - -If your description starts to get too long, that's a sign that you -probably need to split up your commit to finer grained pieces. -That being said, patches which plainly describe the things that -help reviewers check the patch, and future maintainers understand -the code, are the most beautiful patches. Descriptions that summarise -the point in the subject well, and describe the motivation for the -change, the approach taken by the change, and if relevant how this -differs substantially from the prior version, can be found on Usenet -archives back into the late 80's. Consider it like good Netiquette, -but for code. - -Oh, another thing. I am picky about whitespaces. Make sure your -changes do not trigger errors with the sample pre-commit hook shipped -in templates/hooks--pre-commit. To help ensure this does not happen, -run git diff --check on your changes before you commit. - - -(1a) Try to be nice to older C compilers - -We try to support a wide range of C compilers to compile -git with. That means that you should not use C99 initializers, even -if a lot of compilers grok it. - -Also, variables have to be declared at the beginning of the block -(you can check this with gcc, using the -Wdeclaration-after-statement -option). - -Another thing: NULL pointers shall be written as NULL, not as 0. - - -(2) Generate your patch using git tools out of your commits. - -git based diff tools (git, Cogito, and StGIT included) generate -unidiff which is the preferred format. - -You do not have to be afraid to use -M option to "git diff" or -"git format-patch", if your patch involves file renames. The -receiving end can handle them just fine. - -Please make sure your patch does not include any extra files -which do not belong in a patch submission. Make sure to review -your patch after generating it, to ensure accuracy. Before -sending out, please make sure it cleanly applies to the "master" -branch head. If you are preparing a work based on "next" branch, -that is fine, but please mark it as such. - - -(3) Sending your patches. - -People need to be able to read and comment on the changes you are -submitting. It is important for a developer to be able to "quote" -your changes, using standard e-mail tools, so that they may comment -on specific portions of your code. For this reason, all patches -should be submitted "inline". WARNING: Be wary of your MUAs word-wrap -corrupting your patch. Do not cut-n-paste your patch; you can lose -tabs that way if you are not careful. - -It is a common convention to prefix your subject line with -[PATCH]. This lets people easily distinguish patches from other -e-mail discussions. Use of additional markers after PATCH and -the closing bracket to mark the nature of the patch is also -encouraged. E.g. [PATCH/RFC] is often used when the patch is -not ready to be applied but it is for discussion, [PATCH v2], -[PATCH v3] etc. are often seen when you are sending an update to -what you have previously sent. - -"git format-patch" command follows the best current practice to -format the body of an e-mail message. At the beginning of the -patch should come your commit message, ending with the -Signed-off-by: lines, and a line that consists of three dashes, -followed by the diffstat information and the patch itself. If -you are forwarding a patch from somebody else, optionally, at -the beginning of the e-mail message just before the commit -message starts, you can put a "From: " line to name that person. - -You often want to add additional explanation about the patch, -other than the commit message itself. Place such "cover letter" -material between the three dash lines and the diffstat. - -Do not attach the patch as a MIME attachment, compressed or not. -Do not let your e-mail client send quoted-printable. Do not let -your e-mail client send format=flowed which would destroy -whitespaces in your patches. Many -popular e-mail applications will not always transmit a MIME -attachment as plain text, making it impossible to comment on -your code. A MIME attachment also takes a bit more time to -process. This does not decrease the likelihood of your -MIME-attached change being accepted, but it makes it more likely -that it will be postponed. - -Exception: If your mailer is mangling patches then someone may ask -you to re-send them using MIME, that is OK. - -Do not PGP sign your patch, at least for now. Most likely, your -maintainer or other people on the list would not have your PGP -key and would not bother obtaining it anyway. Your patch is not -judged by who you are; a good patch from an unknown origin has a -far better chance of being accepted than a patch from a known, -respected origin that is done poorly or does incorrect things. - -If you really really really really want to do a PGP signed -patch, format it as "multipart/signed", not a text/plain message -that starts with '-----BEGIN PGP SIGNED MESSAGE-----'. That is -not a text/plain, it's something else. - -Unless your patch is a very trivial and an obviously correct one, -first send it with "To:" set to the mailing list, with "cc:" listing -people who are involved in the area you are touching (the output from -"git blame $path" and "git shortlog --no-merges $path" would help to -identify them), to solicit comments and reviews. After the list -reached a consensus that it is a good idea to apply the patch, re-send -it with "To:" set to the maintainer and optionally "cc:" the list for -inclusion. Do not forget to add trailers such as "Acked-by:", -"Reviewed-by:" and "Tested-by:" after your "Signed-off-by:" line as -necessary. - - -(4) Sign your work - -To improve tracking of who did what, we've borrowed the -"sign-off" procedure from the Linux kernel project on patches -that are being emailed around. Although core GIT is a lot -smaller project it is a good discipline to follow it. - -The sign-off is a simple line at the end of the explanation for -the patch, which certifies that you wrote it or otherwise have -the right to pass it on as a open-source patch. The rules are -pretty simple: if you can certify the below: - - Developer's Certificate of Origin 1.1 - - By making a contribution to this project, I certify that: - - (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - - (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - - (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - - (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. - -then you just add a line saying - - Signed-off-by: Random J Developer - -This line can be automatically added by git if you run the git-commit -command with the -s option. - -Notice that you can place your own Signed-off-by: line when -forwarding somebody else's patch with the above rules for -D-C-O. Indeed you are encouraged to do so. Do not forget to -place an in-body "From: " line at the beginning to properly attribute -the change to its true author (see (2) above). - -Also notice that a real name is used in the Signed-off-by: line. Please -don't hide your real name. - -Some people also put extra tags at the end. - -"Acked-by:" says that the patch was reviewed by the person who -is more familiar with the issues and the area the patch attempts -to modify. "Tested-by:" says the patch was tested by the person -and found to have the desired effect. - ------------------------------------------------- -An ideal patch flow - -Here is an ideal patch flow for this project the current maintainer -suggests to the contributors: - - (0) You come up with an itch. You code it up. - - (1) Send it to the bug tracker and cc people who may need to know about - the change. - - The people who may need to know are the ones whose code you - are butchering. These people happen to be the ones who are - most likely to be knowledgeable enough to help you, but - they have no obligation to help you (i.e. you ask for help, - don't demand). "git log -p -- $area_you_are_modifying" would - help you find out who they are. - - (2) You get comments and suggestions for improvements. You may - even get them in a "on top of your change" patch form. - - (3) Polish, refine, and re-send to the list and the people who - spend their time to improve your patch. Go back to step (2). - - (4) The list forms consensus that the last round of your patch is - good. Send it to the list and cc the maintainer. - - (5) A topic branch is created with the patch and is merged to 'next', - and cooked further and eventually graduates to 'master'. - -In any time between the (2)-(3) cycle, the maintainer may pick it up -from the list and queue it to 'pu', in order to make it easier for -people play with it without having to pick up and apply the patch to -their trees themselves. - ------------------------------------------------- -Know the status of your patch after submission - -* You can use Git itself to find out when your patch is merged in - master. 'git pull --rebase' will automatically skip already-applied - patches, and will let you know. This works only if you rebase on top - of the branch in which your patch has been merged (i.e. it will not - tell you if your patch is merged in pu if you rebase on top of - master). - ------------------------------------------------- -MUA specific hints - -Some of patches I receive or pick up from the list share common -patterns of breakage. Please make sure your MUA is set up -properly not to corrupt whitespaces. Here are two common ones -I have seen: - -* Empty context lines that do not have _any_ whitespace. - -* Non empty context lines that have one extra whitespace at the - beginning. - -One test you could do yourself if your MUA is set up correctly is: - -* Send the patch to yourself, exactly the way you would, except - To: and Cc: lines, which would not contain the list and - maintainer address. - -* Save that patch to a file in UNIX mailbox format. Call it say - a.patch. - -* Try to apply to the tip of the "master" branch from the - git.git public repository: - - $ git fetch http://kernel.org/pub/scm/git/git.git master:test-apply - $ git checkout test-apply - $ git reset --hard - $ git am a.patch - -If it does not apply correctly, there can be various reasons. - -* Your patch itself does not apply cleanly. That is _bad_ but - does not have much to do with your MUA. Please rebase the - patch appropriately. - -* Your MUA corrupted your patch; "am" would complain that - the patch does not apply. Look at .git/rebase-apply/ subdirectory and - see what 'patch' file contains and check for the common - corruption patterns mentioned above. - -* While you are at it, check what are in 'info' and - 'final-commit' files as well. If what is in 'final-commit' is - not exactly what you would want to see in the commit log - message, it is very likely that your maintainer would end up - hand editing the log message when he applies your patch. - Things like "Hi, this is my first patch.\n", if you really - want to put in the patch e-mail, should come after the - three-dash line that signals the end of the commit message. - - -Pine ----- - -(Johannes Schindelin) - -I don't know how many people still use pine, but for those poor -souls it may be good to mention that the quell-flowed-text is -needed for recent versions. - -... the "no-strip-whitespace-before-send" option, too. AFAIK it -was introduced in 4.60. - -(Linus Torvalds) - -And 4.58 needs at least this. - ---- -diff-tree 8326dd8350be64ac7fc805f6563a1d61ad10d32c (from e886a61f76edf5410573e92e38ce22974f9c40f1) -Author: Linus Torvalds -Date: Mon Aug 15 17:23:51 2005 -0700 - - Fix pine whitespace-corruption bug - - There's no excuse for unconditionally removing whitespace from - the pico buffers on close. - -diff --git a/pico/pico.c b/pico/pico.c ---- a/pico/pico.c -+++ b/pico/pico.c -@@ -219,7 +219,9 @@ PICO *pm; - switch(pico_all_done){ /* prepare for/handle final events */ - case COMP_EXIT : /* already confirmed */ - packheader(); -+#if 0 - stripwhitespace(); -+#endif - c |= COMP_EXIT; - break; - - -(Daniel Barkalow) - -> A patch to SubmittingPatches, MUA specific help section for -> users of Pine 4.63 would be very much appreciated. - -Ah, it looks like a recent version changed the default behavior to do the -right thing, and inverted the sense of the configuration option. (Either -that or Gentoo did it.) So you need to set the -"no-strip-whitespace-before-send" option, unless the option you have is -"strip-whitespace-before-send", in which case you should avoid checking -it. - - -Thunderbird ------------ - -(A Large Angry SCM) - -By default, Thunderbird will both wrap emails as well as flag them as -being 'format=flowed', both of which will make the resulting email unusable -by git. - -Here are some hints on how to successfully submit patches inline using -Thunderbird. - -There are two different approaches. One approach is to configure -Thunderbird to not mangle patches. The second approach is to use -an external editor to keep Thunderbird from mangling the patches. - -Approach #1 (configuration): - -This recipe is current as of Thunderbird 2.0.0.19. Three steps: - 1. Configure your mail server composition as plain text - Edit...Account Settings...Composition & Addressing, - uncheck 'Compose Messages in HTML'. - 2. Configure your general composition window to not wrap - Edit..Preferences..Composition, wrap plain text messages at 0 - 3. Disable the use of format=flowed - Edit..Preferences..Advanced..Config Editor. Search for: - mailnews.send_plaintext_flowed - toggle it to make sure it is set to 'false'. - -After that is done, you should be able to compose email as you -otherwise would (cut + paste, git-format-patch | git-imap-send, etc), -and the patches should not be mangled. - -Approach #2 (external editor): - -This recipe appears to work with the current [*1*] Thunderbird from Suse. - -The following Thunderbird extensions are needed: - AboutConfig 0.5 - http://aboutconfig.mozdev.org/ - External Editor 0.7.2 - http://globs.org/articles.php?lng=en&pg=8 - -1) Prepare the patch as a text file using your method of choice. - -2) Before opening a compose window, use Edit->Account Settings to -uncheck the "Compose messages in HTML format" setting in the -"Composition & Addressing" panel of the account to be used to send the -patch. [*2*] - -3) In the main Thunderbird window, _before_ you open the compose window -for the patch, use Tools->about:config to set the following to the -indicated values: - mailnews.send_plaintext_flowed => false - mailnews.wraplength => 0 - -4) Open a compose window and click the external editor icon. - -5) In the external editor window, read in the patch file and exit the -editor normally. - -6) Back in the compose window: Add whatever other text you wish to the -message, complete the addressing and subject fields, and press send. - -7) Optionally, undo the about:config/account settings changes made in -steps 2 & 3. - - -[Footnotes] -*1* Version 1.0 (20041207) from the MozillaThunderbird-1.0-5 rpm of Suse -9.3 professional updates. - -*2* It may be possible to do this with about:config and the following -settings but I haven't tried, yet. - mail.html_compose => false - mail.identity.default.compose_html => false - mail.identity.id?.compose_html => false - -(Lukas Sandström) - -There is a script in contrib/thunderbird-patch-inline which can help -you include patches with Thunderbird in an easy way. To use it, do the -steps above and then use the script as the external editor. - -Gnus ----- - -'|' in the *Summary* buffer can be used to pipe the current -message to an external program, and this is a handy way to drive -"git am". However, if the message is MIME encoded, what is -piped into the program is the representation you see in your -*Article* buffer after unwrapping MIME. This is often not what -you would want for two reasons. It tends to screw up non ASCII -characters (most notably in people's names), and also -whitespaces (fatal in patches). Running 'C-u g' to display the -message in raw form before using '|' to run the pipe can work -this problem around. - - -KMail ------ - -This should help you to submit patches inline using KMail. - -1) Prepare the patch as a text file. - -2) Click on New Mail. - -3) Go under "Options" in the Composer window and be sure that -"Word wrap" is not set. - -4) Use Message -> Insert file... and insert the patch. - -5) Back in the compose window: add whatever other text you wish to the -message, complete the addressing and subject fields, and press send. - - -Gmail ------ - -GMail does not appear to have any way to turn off line wrapping in the web -interface, so this will mangle any emails that you send. You can however -use "git send e-mail" and send your patches through the GMail SMTP server, or -use any IMAP email client to connect to the google IMAP server and forward -the emails through that. - -To use "git send-email" and send your patches through the GMail SMTP server, -edit ~/.gitconfig to specify your account settings: - -[sendemail] - smtpencryption = tls - smtpserver = smtp.gmail.com - smtpuser = user@gmail.com - smtppass = p4ssw0rd - smtpserverport = 587 - -Once your commits are ready to be sent to the mailing list, run the -following commands: - - $ git format-patch --cover-letter -M origin/master -o outgoing/ - $ edit outgoing/0000-* - $ git send-email outgoing/* - -To submit using the IMAP interface, first, edit your ~/.gitconfig to specify your -account settings: - -[imap] - folder = "[Gmail]/Drafts" - host = imaps://imap.gmail.com - user = user@gmail.com - pass = p4ssw0rd - port = 993 - sslverify = false - -You might need to instead use: folder = "[Google Mail]/Drafts" if you get an error -that the "Folder doesn't exist". - -Once your commits are ready to be sent to the mailing list, run the -following commands: - - $ git format-patch --cover-letter -M --stdout origin/master | git imap-send - -Just make sure to disable line wrapping in the email client (GMail web -interface will line wrap no matter what, so you need to use a real -IMAP client). - diff --git a/src/lib/Template/ShowStartStop.pm b/src/lib/Template/ShowStartStop.pm deleted file mode 100644 index da2b5ff..0000000 --- a/src/lib/Template/ShowStartStop.pm +++ /dev/null @@ -1,92 +0,0 @@ -package Template::ShowStartStop; -use strict; -use warnings; -use parent qw( Template::Context ); - -my $sub = qw(process); - -my $super = __PACKAGE__->can("SUPER::$sub") or die; - -my $wrapped = sub { - my $self = shift; - my $what = shift; # what template are we working with - - my $template # get the template filename - # conditional # set $template to - = ref($what) eq 'ARRAY' ? join( ' + ', @{$what} ) - : ref($what) ? $what->name - : $what - ; - - my $processed_data = $super->($self, $what, @_); - - my $output - = "\n" - . "$processed_data" - . "\n" - ; - - return $output; -}; - -{ no strict 'refs'; *{$sub} = $wrapped; } - -1; -__END__ -# ABSTRACT: Display where template's start and stop -=head1 SYNOPSIS - - use Template::ShowStartStop; - - my $tt = Template->new({ - CONTEXT => Template::ShowStartStop->new - }); - -=head1 DESCRIPTION - -Template::ShowStartStop provides inline comments througout your code where -each template stops and starts. It's an overridden version of L -that wraps the C method. - -Using Template::ShowStartStop is simple. -Now when you process templates, HTML comments will get embedded in your -output, which you can easily grep for. The nesting level is also shown. - - - - - .... - - - -=head1 BUGS - -Please report any bugs or feature requests on -L -as I'm not fond of RT. - -=head1 ACKNOWLEDGEMENTS - -Thanks to -Andy Lester, -Randal Schwartz, -Bill Moseley, -and to Gavin Estey for the original Template::Timer code that this is based on. - -=cut - -# notes from an IRC conversation on how to improve this module -[Tuesday 02 March 2010] [04:26:51 pm] xenoterracide: you can get rid -of foreach, since you only wrap one method, also drop my $super = ...;, remove -'no strict', change '*{$sub} = sub {' for 'my $wrappedSub = sub {', use 'my -$processed_data = $self->SUPER::process(...)', and at the end put { no strict -'refs'; *{'process'} = $wrappedSub; }. -[Tuesday 02 March 2010] [04:32:10 pm] tm604 would I still -need the foreach if I was still wrapping include? -[Tuesday 02 March 2010] [04:32:31 pm] xenoterracide: Not really, -because it's needless complexity for something that's just subclassing one or -two methods. -[Tuesday 02 March 2010] [04:32:49 pm] k -[Tuesday 02 March 2010] [04:35:08 pm] xenoterracide: Just put the -common code in a single sub, and have it call include or process as -appropriate. diff --git a/src/t/basic.t b/src/t/basic.t deleted file mode 100644 index e64ec58..0000000 --- a/src/t/basic.t +++ /dev/null @@ -1,32 +0,0 @@ -#!perl -T -use strict; -use warnings; - -use Test::More; - -BEGIN { use_ok( 'Template' ); } -BEGIN { use_ok( 'Template::ShowStartStop' ); } - -my $tt = Template->new({ - CONTEXT => Template::ShowStartStop->new -}); - -my $vars = { - var => 'world', -}; - -my $final_output = < -hello world - -END - -my $output = \do{ my $i }; #use anonymous scalar - -ok( $tt->process(\*DATA, $vars, $output), 'process template'); - -is( $$output, $final_output, 'test hello world output'); - -done_testing(); -__DATA__ -hello [% var %] diff --git a/src/t/eval.t b/src/t/eval.t deleted file mode 100644 index 92b09d4..0000000 --- a/src/t/eval.t +++ /dev/null @@ -1,26 +0,0 @@ -#!perl -T - -use strict; -use warnings; - -use Test::More tests => 3; - -BEGIN { use_ok( 'Template' ); } -BEGIN { use_ok( 'Template::ShowStartStop' ); } - -my $tt = - Template->new( { - CONTEXT => Template::ShowStartStop->new - } ); - -my $block = q{[% thing = 'doohickey' %]}; - -TODO: { # See RT # 13225 - local $TODO = 'Problem identified but not fixed'; - my $rc = $tt->process( \*DATA, { block => $block } ); - ok( $rc, 'eval' ); -} - -__DATA__ -[% block | eval %] -[% thing %] diff --git a/t/00-compile.t b/t/00-compile.t deleted file mode 100644 index dde11d9..0000000 --- a/t/00-compile.t +++ /dev/null @@ -1,44 +0,0 @@ -#!perl - -use strict; -use warnings; - -use Test::More; -use File::Find; -use File::Temp qw{ tempdir }; - -my @modules; -find( - sub { - return if $File::Find::name !~ /\.pm\z/; - my $found = $File::Find::name; - $found =~ s{^lib/}{}; - $found =~ s{[/\\]}{::}g; - $found =~ s/\.pm$//; - # nothing to skip - push @modules, $found; - }, - 'lib', -); - -my @scripts = glob "bin/*"; - -plan tests => scalar(@modules) + scalar(@scripts); - -{ - # fake home for cpan-testers - # no fake requested ## local $ENV{HOME} = tempdir( CLEANUP => 1 ); - - is( qx{ $^X -Ilib -e "use $_; print '$_ ok'" }, "$_ ok", "$_ loaded ok" ) - for sort @modules; - - SKIP: { - eval "use Test::Script; 1;"; - skip "Test::Script needed to test script compilation", scalar(@scripts) if $@; - foreach my $file ( @scripts ) { - my $script = $file; - $script =~ s!.*/!!; - script_compiles_ok( $file, "$script script compiles" ); - } - } -} diff --git a/t/000-report-versions.t b/t/000-report-versions.t deleted file mode 100644 index 6407bd7..0000000 --- a/t/000-report-versions.t +++ /dev/null @@ -1,444 +0,0 @@ -#!perl -use warnings; -use strict; -use Test::More 0.94; - -# Include a cut-down version of YAML::Tiny so we don't introduce unnecessary -# dependencies ourselves. - -package Local::YAML::Tiny; - -use strict; -use Carp 'croak'; - -# UTF Support? -sub HAVE_UTF8 () { $] >= 5.007003 } -BEGIN { - if ( HAVE_UTF8 ) { - # The string eval helps hide this from Test::MinimumVersion - eval "require utf8;"; - die "Failed to load UTF-8 support" if $@; - } - - # Class structure - require 5.004; - $YAML::Tiny::VERSION = '1.40'; - - # Error storage - $YAML::Tiny::errstr = ''; -} - -# Printable characters for escapes -my %UNESCAPES = ( - z => "\x00", a => "\x07", t => "\x09", - n => "\x0a", v => "\x0b", f => "\x0c", - r => "\x0d", e => "\x1b", '\\' => '\\', -); - - -##################################################################### -# Implementation - -# Create an empty YAML::Tiny object -sub new { - my $class = shift; - bless [ @_ ], $class; -} - -# Create an object from a file -sub read { - my $class = ref $_[0] ? ref shift : shift; - - # Check the file - my $file = shift or return $class->_error( 'You did not specify a file name' ); - return $class->_error( "File '$file' does not exist" ) unless -e $file; - return $class->_error( "'$file' is a directory, not a file" ) unless -f _; - return $class->_error( "Insufficient permissions to read '$file'" ) unless -r _; - - # Slurp in the file - local $/ = undef; - local *CFG; - unless ( open(CFG, $file) ) { - return $class->_error("Failed to open file '$file': $!"); - } - my $contents = ; - unless ( close(CFG) ) { - return $class->_error("Failed to close file '$file': $!"); - } - - $class->read_string( $contents ); -} - -# Create an object from a string -sub read_string { - my $class = ref $_[0] ? ref shift : shift; - my $self = bless [], $class; - my $string = $_[0]; - unless ( defined $string ) { - return $self->_error("Did not provide a string to load"); - } - - # Byte order marks - # NOTE: Keeping this here to educate maintainers - # my %BOM = ( - # "\357\273\277" => 'UTF-8', - # "\376\377" => 'UTF-16BE', - # "\377\376" => 'UTF-16LE', - # "\377\376\0\0" => 'UTF-32LE' - # "\0\0\376\377" => 'UTF-32BE', - # ); - if ( $string =~ /^(?:\376\377|\377\376|\377\376\0\0|\0\0\376\377)/ ) { - return $self->_error("Stream has a non UTF-8 BOM"); - } else { - # Strip UTF-8 bom if found, we'll just ignore it - $string =~ s/^\357\273\277//; - } - - # Try to decode as utf8 - utf8::decode($string) if HAVE_UTF8; - - # Check for some special cases - return $self unless length $string; - unless ( $string =~ /[\012\015]+\z/ ) { - return $self->_error("Stream does not end with newline character"); - } - - # Split the file into lines - my @lines = grep { ! /^\s*(?:\#.*)?\z/ } - split /(?:\015{1,2}\012|\015|\012)/, $string; - - # Strip the initial YAML header - @lines and $lines[0] =~ /^\%YAML[: ][\d\.]+.*\z/ and shift @lines; - - # A nibbling parser - while ( @lines ) { - # Do we have a document header? - if ( $lines[0] =~ /^---\s*(?:(.+)\s*)?\z/ ) { - # Handle scalar documents - shift @lines; - if ( defined $1 and $1 !~ /^(?:\#.+|\%YAML[: ][\d\.]+)\z/ ) { - push @$self, $self->_read_scalar( "$1", [ undef ], \@lines ); - next; - } - } - - if ( ! @lines or $lines[0] =~ /^(?:---|\.\.\.)/ ) { - # A naked document - push @$self, undef; - while ( @lines and $lines[0] !~ /^---/ ) { - shift @lines; - } - - } elsif ( $lines[0] =~ /^\s*\-/ ) { - # An array at the root - my $document = [ ]; - push @$self, $document; - $self->_read_array( $document, [ 0 ], \@lines ); - - } elsif ( $lines[0] =~ /^(\s*)\S/ ) { - # A hash at the root - my $document = { }; - push @$self, $document; - $self->_read_hash( $document, [ length($1) ], \@lines ); - - } else { - croak("YAML::Tiny failed to classify the line '$lines[0]'"); - } - } - - $self; -} - -# Deparse a scalar string to the actual scalar -sub _read_scalar { - my ($self, $string, $indent, $lines) = @_; - - # Trim trailing whitespace - $string =~ s/\s*\z//; - - # Explitic null/undef - return undef if $string eq '~'; - - # Quotes - if ( $string =~ /^\'(.*?)\'\z/ ) { - return '' unless defined $1; - $string = $1; - $string =~ s/\'\'/\'/g; - return $string; - } - if ( $string =~ /^\"((?:\\.|[^\"])*)\"\z/ ) { - # Reusing the variable is a little ugly, - # but avoids a new variable and a string copy. - $string = $1; - $string =~ s/\\"/"/g; - $string =~ s/\\([never\\fartz]|x([0-9a-fA-F]{2}))/(length($1)>1)?pack("H2",$2):$UNESCAPES{$1}/gex; - return $string; - } - - # Special cases - if ( $string =~ /^[\'\"!&]/ ) { - croak("YAML::Tiny does not support a feature in line '$lines->[0]'"); - } - return {} if $string eq '{}'; - return [] if $string eq '[]'; - - # Regular unquoted string - return $string unless $string =~ /^[>|]/; - - # Error - croak("YAML::Tiny failed to find multi-line scalar content") unless @$lines; - - # Check the indent depth - $lines->[0] =~ /^(\s*)/; - $indent->[-1] = length("$1"); - if ( defined $indent->[-2] and $indent->[-1] <= $indent->[-2] ) { - croak("YAML::Tiny found bad indenting in line '$lines->[0]'"); - } - - # Pull the lines - my @multiline = (); - while ( @$lines ) { - $lines->[0] =~ /^(\s*)/; - last unless length($1) >= $indent->[-1]; - push @multiline, substr(shift(@$lines), length($1)); - } - - my $j = (substr($string, 0, 1) eq '>') ? ' ' : "\n"; - my $t = (substr($string, 1, 1) eq '-') ? '' : "\n"; - return join( $j, @multiline ) . $t; -} - -# Parse an array -sub _read_array { - my ($self, $array, $indent, $lines) = @_; - - while ( @$lines ) { - # Check for a new document - if ( $lines->[0] =~ /^(?:---|\.\.\.)/ ) { - while ( @$lines and $lines->[0] !~ /^---/ ) { - shift @$lines; - } - return 1; - } - - # Check the indent level - $lines->[0] =~ /^(\s*)/; - if ( length($1) < $indent->[-1] ) { - return 1; - } elsif ( length($1) > $indent->[-1] ) { - croak("YAML::Tiny found bad indenting in line '$lines->[0]'"); - } - - if ( $lines->[0] =~ /^(\s*\-\s+)[^\'\"]\S*\s*:(?:\s+|$)/ ) { - # Inline nested hash - my $indent2 = length("$1"); - $lines->[0] =~ s/-/ /; - push @$array, { }; - $self->_read_hash( $array->[-1], [ @$indent, $indent2 ], $lines ); - - } elsif ( $lines->[0] =~ /^\s*\-(\s*)(.+?)\s*\z/ ) { - # Array entry with a value - shift @$lines; - push @$array, $self->_read_scalar( "$2", [ @$indent, undef ], $lines ); - - } elsif ( $lines->[0] =~ /^\s*\-\s*\z/ ) { - shift @$lines; - unless ( @$lines ) { - push @$array, undef; - return 1; - } - if ( $lines->[0] =~ /^(\s*)\-/ ) { - my $indent2 = length("$1"); - if ( $indent->[-1] == $indent2 ) { - # Null array entry - push @$array, undef; - } else { - # Naked indenter - push @$array, [ ]; - $self->_read_array( $array->[-1], [ @$indent, $indent2 ], $lines ); - } - - } elsif ( $lines->[0] =~ /^(\s*)\S/ ) { - push @$array, { }; - $self->_read_hash( $array->[-1], [ @$indent, length("$1") ], $lines ); - - } else { - croak("YAML::Tiny failed to classify line '$lines->[0]'"); - } - - } elsif ( defined $indent->[-2] and $indent->[-1] == $indent->[-2] ) { - # This is probably a structure like the following... - # --- - # foo: - # - list - # bar: value - # - # ... so lets return and let the hash parser handle it - return 1; - - } else { - croak("YAML::Tiny failed to classify line '$lines->[0]'"); - } - } - - return 1; -} - -# Parse an array -sub _read_hash { - my ($self, $hash, $indent, $lines) = @_; - - while ( @$lines ) { - # Check for a new document - if ( $lines->[0] =~ /^(?:---|\.\.\.)/ ) { - while ( @$lines and $lines->[0] !~ /^---/ ) { - shift @$lines; - } - return 1; - } - - # Check the indent level - $lines->[0] =~ /^(\s*)/; - if ( length($1) < $indent->[-1] ) { - return 1; - } elsif ( length($1) > $indent->[-1] ) { - croak("YAML::Tiny found bad indenting in line '$lines->[0]'"); - } - - # Get the key - unless ( $lines->[0] =~ s/^\s*([^\'\" ][^\n]*?)\s*:(\s+|$)// ) { - if ( $lines->[0] =~ /^\s*[?\'\"]/ ) { - croak("YAML::Tiny does not support a feature in line '$lines->[0]'"); - } - croak("YAML::Tiny failed to classify line '$lines->[0]'"); - } - my $key = $1; - - # Do we have a value? - if ( length $lines->[0] ) { - # Yes - $hash->{$key} = $self->_read_scalar( shift(@$lines), [ @$indent, undef ], $lines ); - } else { - # An indent - shift @$lines; - unless ( @$lines ) { - $hash->{$key} = undef; - return 1; - } - if ( $lines->[0] =~ /^(\s*)-/ ) { - $hash->{$key} = []; - $self->_read_array( $hash->{$key}, [ @$indent, length($1) ], $lines ); - } elsif ( $lines->[0] =~ /^(\s*)./ ) { - my $indent2 = length("$1"); - if ( $indent->[-1] >= $indent2 ) { - # Null hash entry - $hash->{$key} = undef; - } else { - $hash->{$key} = {}; - $self->_read_hash( $hash->{$key}, [ @$indent, length($1) ], $lines ); - } - } - } - } - - return 1; -} - -# Set error -sub _error { - $YAML::Tiny::errstr = $_[1]; - undef; -} - -# Retrieve error -sub errstr { - $YAML::Tiny::errstr; -} - - - -##################################################################### -# Use Scalar::Util if possible, otherwise emulate it - -BEGIN { - eval { - require Scalar::Util; - }; - if ( $@ ) { - # Failed to load Scalar::Util - eval <<'END_PERL'; -sub refaddr { - my $pkg = ref($_[0]) or return undef; - if (!!UNIVERSAL::can($_[0], 'can')) { - bless $_[0], 'Scalar::Util::Fake'; - } else { - $pkg = undef; - } - "$_[0]" =~ /0x(\w+)/; - my $i = do { local $^W; hex $1 }; - bless $_[0], $pkg if defined $pkg; - $i; -} -END_PERL - } else { - Scalar::Util->import('refaddr'); - } -} - - -##################################################################### -# main test -##################################################################### - -package main; - -BEGIN { - - # Skip modules that either don't want to be loaded directly, such as - # Module::Install, or that mess with the test count, such as the Test::* - # modules listed here. - # - # Moose::Role conflicts if Moose is loaded as well, but Moose::Role is in - # the Moose distribution and it's certain that someone who uses - # Moose::Role also uses Moose somewhere, so if we disallow Moose::Role, - # we'll still get the relevant version number. - - my %skip = map { $_ => 1 } qw( - App::FatPacker - Class::Accessor::Classy - Devel::Cover - Module::Install - Moose::Role - Test::Kwalitee - Test::Pod::Coverage - Test::Portability::Files - Test::YAML::Meta - ); - - my $Test = Test::Builder->new; - - $Test->plan(skip_all => "META.yml could not be found") - unless -f 'META.yml' and -r _; - - my $meta = (Local::YAML::Tiny->read('META.yml'))->[0]; - my %requires; - for my $require_key (grep { /requires/ } keys %$meta) { - my %h = %{ $meta->{$require_key} }; - $requires{$_}++ for keys %h; - } - delete $requires{perl}; - - diag("Testing with Perl $], $^X"); - for my $module (sort keys %requires) { - if ($skip{$module}) { - note "$module doesn't want to be loaded directly, skipping"; - next; - } - local $SIG{__WARN__} = sub { note "$module: $_[0]" }; - use_ok $module or BAIL_OUT("can't load $module"); - my $version = $module->VERSION; - $version = 'undefined' unless defined $version; - diag(" $module version is $version"); - } - done_testing; -} diff --git a/t/release-distmeta.t b/t/release-distmeta.t deleted file mode 100644 index 503f951..0000000 --- a/t/release-distmeta.t +++ /dev/null @@ -1,15 +0,0 @@ -#!perl - -BEGIN { - unless ($ENV{RELEASE_TESTING}) { - require Test::More; - Test::More::plan(skip_all => 'these tests are for release candidate testing'); - } -} - - -use Test::More; - -eval "use Test::CPAN::Meta"; -plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@; -meta_yaml_ok(); \ No newline at end of file diff --git a/t/release-minimum-version.t b/t/release-minimum-version.t deleted file mode 100644 index 3b1635b..0000000 --- a/t/release-minimum-version.t +++ /dev/null @@ -1,16 +0,0 @@ -#!perl - -BEGIN { - unless ($ENV{RELEASE_TESTING}) { - require Test::More; - Test::More::plan(skip_all => 'these tests are for release candidate testing'); - } -} - - -use Test::More; - -eval "use Test::MinimumVersion"; -plan skip_all => "Test::MinimumVersion required for testing minimum versions" - if $@; -all_minimum_version_from_metayml_ok(); \ No newline at end of file diff --git a/t/release-pod-coverage.t b/t/release-pod-coverage.t deleted file mode 100644 index f8b3ebd..0000000 --- a/t/release-pod-coverage.t +++ /dev/null @@ -1,21 +0,0 @@ -#!perl - -BEGIN { - unless ($ENV{RELEASE_TESTING}) { - require Test::More; - Test::More::plan(skip_all => 'these tests are for release candidate testing'); - } -} - - -use Test::More; - -eval "use Test::Pod::Coverage 1.08"; -plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage" - if $@; - -eval "use Pod::Coverage::TrustPod"; -plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage" - if $@; - -all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); \ No newline at end of file diff --git a/t/release-pod-syntax.t b/t/release-pod-syntax.t deleted file mode 100644 index 66c8fff..0000000 --- a/t/release-pod-syntax.t +++ /dev/null @@ -1,15 +0,0 @@ -#!perl - -BEGIN { - unless ($ENV{RELEASE_TESTING}) { - require Test::More; - Test::More::plan(skip_all => 'these tests are for release candidate testing'); - } -} - -use Test::More; - -eval "use Test::Pod 1.41"; -plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; - -all_pod_files_ok(); \ No newline at end of file diff --git a/t/release-synopsis.t b/t/release-synopsis.t deleted file mode 100644 index f30a1da..0000000 --- a/t/release-synopsis.t +++ /dev/null @@ -1,16 +0,0 @@ -#!perl - -BEGIN { - unless ($ENV{RELEASE_TESTING}) { - require Test::More; - Test::More::plan(skip_all => 'these tests are for release candidate testing'); - } -} - - -use Test::More; - -eval "use Test::Synopsis"; -plan skip_all => "Test::Synopsis required for testing synopses" - if $@; -all_synopsis_ok('lib'); \ No newline at end of file From 6a56ff0482ad2f9076bd1e5014943163c8f58784 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 26 May 2010 21:22:46 -0400 Subject: [PATCH 074/140] add HasVersionTests --- dist.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/dist.ini b/dist.ini index 028b759..d8e0f76 100644 --- a/dist.ini +++ b/dist.ini @@ -29,6 +29,7 @@ remove = Readme [CompileTests] [MinimumVersionTests] [MetaTests] +[HasVersionTests] [@Git] push_to = my From 9ad1b90c35710cb7430448f002d9e07a25b119cb Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 26 May 2010 21:25:48 -0400 Subject: [PATCH 075/140] check that git is in clean state before release --- dist.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/dist.ini b/dist.ini index d8e0f76..18e0001 100644 --- a/dist.ini +++ b/dist.ini @@ -36,3 +36,4 @@ push_to = my tag_format = %v [Git::CommitBuild] +[Git::Check] From 5c656688f62d6ca1694128d718bdea7d3cd7ddc0 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 26 May 2010 22:20:29 -0400 Subject: [PATCH 076/140] add Dist Manifest Tests --- dist.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/dist.ini b/dist.ini index 18e0001..0f0dd84 100644 --- a/dist.ini +++ b/dist.ini @@ -30,6 +30,7 @@ remove = Readme [MinimumVersionTests] [MetaTests] [HasVersionTests] +[DistManifestTests] [@Git] push_to = my From 9758a610c527d6e3a6108a01095c495d953e6362 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 26 May 2010 22:47:47 -0400 Subject: [PATCH 077/140] Prune Cruft --- dist.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/dist.ini b/dist.ini index 0f0dd84..d78e778 100644 --- a/dist.ini +++ b/dist.ini @@ -32,6 +32,7 @@ remove = Readme [HasVersionTests] [DistManifestTests] +[PruneCruft] [@Git] push_to = my tag_format = %v From c8bc91dcffef6c1605373fe2178d353f2183ba74 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 26 May 2010 22:55:35 -0400 Subject: [PATCH 078/140] change to pass more Critic tests --- lib/Template/ShowStartStop.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index da2b5ff..694942d 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -1,6 +1,7 @@ -package Template::ShowStartStop; use strict; use warnings; + +package Template::ShowStartStop; use parent qw( Template::Context ); my $sub = qw(process); From 60fb35cb914093b3cdff404b41f517298b12e560 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 26 May 2010 23:10:03 -0400 Subject: [PATCH 079/140] convert to use Template::Test --- t/basic.t | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/t/basic.t b/t/basic.t index e64ec58..70899d3 100644 --- a/t/basic.t +++ b/t/basic.t @@ -1,11 +1,8 @@ -#!perl -T +#!perl use strict; use warnings; - -use Test::More; - -BEGIN { use_ok( 'Template' ); } -BEGIN { use_ok( 'Template::ShowStartStop' ); } +use Template::ShowStartStop; +use Template::Test; my $tt = Template->new({ CONTEXT => Template::ShowStartStop->new @@ -15,18 +12,12 @@ my $vars = { var => 'world', }; -my $final_output = < -hello world - -END - -my $output = \do{ my $i }; #use anonymous scalar +test_expect(\*DATA, $tt, $vars); -ok( $tt->process(\*DATA, $vars, $output), 'process template'); - -is( $$output, $final_output, 'test hello world output'); - -done_testing(); __DATA__ +--test-- hello [% var %] +--expect-- + +hello world + From 5db93b3e2eb37c1865af680bf9ea6e4298f961c9 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 00:03:57 -0400 Subject: [PATCH 080/140] test INSERT Signed-off-by: Caleb Cushing --- t/insert.t | 25 +++++++++++++++++++++++++ t/templates/how.tt | 1 + 2 files changed, 26 insertions(+) create mode 100644 t/insert.t create mode 100644 t/templates/how.tt diff --git a/t/insert.t b/t/insert.t new file mode 100644 index 0000000..2eff61b --- /dev/null +++ b/t/insert.t @@ -0,0 +1,25 @@ +#!perl +use strict; +use warnings; +use Template::ShowStartStop; +use Template::Test; + +my $tt = Template->new({ + CONTEXT => Template::ShowStartStop->new, +}); + +my $vars = { + var => 'world', +}; + +test_expect(\*DATA, $tt, $vars); + +__DATA__ +--test-- +hello [% var %] +[% INSERT t/templates/how.tt -%] +--expect-- + +hello world +How are you today? + diff --git a/t/templates/how.tt b/t/templates/how.tt new file mode 100644 index 0000000..395f3ec --- /dev/null +++ b/t/templates/how.tt @@ -0,0 +1 @@ +How are you today? From 77e180359b6ed45761568920e08f06451db36dfe Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 00:17:19 -0400 Subject: [PATCH 081/140] test INCLUDEs Signed-off-by: Caleb Cushing --- t/include.t | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 t/include.t diff --git a/t/include.t b/t/include.t new file mode 100644 index 0000000..2e69817 --- /dev/null +++ b/t/include.t @@ -0,0 +1,27 @@ +#!perl +use strict; +use warnings; +use Template::ShowStartStop; +use Template::Test; + +my $tt = Template->new({ + CONTEXT => Template::ShowStartStop->new, +}); + +my $vars = { + var => 'world', +}; + +test_expect(\*DATA, $tt, $vars); + +__DATA__ +--test-- +hello [% var %] +[% INCLUDE t/templates/how.tt -%] +--expect-- + +hello world + +How are you today? + + From 94bb6fe819fa8ec77656f0c3473a393560474fa9 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 00:27:54 -0400 Subject: [PATCH 082/140] prune .ini's Signed-off-by: Caleb Cushing --- dist.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dist.ini b/dist.ini index d78e778..61b756d 100644 --- a/dist.ini +++ b/dist.ini @@ -33,6 +33,10 @@ remove = Readme [DistManifestTests] [PruneCruft] +[PruneFiles] +filenames = dist.ini +filenames = weaver.ini + [@Git] push_to = my tag_format = %v From de4e0e440bbd9452a681bb2f9d53c9f81c90aa7c Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 00:29:25 -0400 Subject: [PATCH 083/140] remove redundant PruneCruft Signed-off-by: Caleb Cushing --- dist.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/dist.ini b/dist.ini index 61b756d..a890639 100644 --- a/dist.ini +++ b/dist.ini @@ -32,7 +32,6 @@ remove = Readme [HasVersionTests] [DistManifestTests] -[PruneCruft] [PruneFiles] filenames = dist.ini filenames = weaver.ini From de4f34c3f5fa6acd1e4615d86267174065ee24e7 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 00:32:55 -0400 Subject: [PATCH 084/140] test PROCESS Signed-off-by: Caleb Cushing --- t/process.t | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 t/process.t diff --git a/t/process.t b/t/process.t new file mode 100644 index 0000000..57d3387 --- /dev/null +++ b/t/process.t @@ -0,0 +1,27 @@ +#!perl +use strict; +use warnings; +use Template::ShowStartStop; +use Template::Test; + +my $tt = Template->new({ + CONTEXT => Template::ShowStartStop->new, +}); + +my $vars = { + var => 'world', +}; + +test_expect(\*DATA, $tt, $vars); + +__DATA__ +--test-- +hello [% var %] +[% PROCESS t/templates/how.tt -%] +--expect-- + +hello world + +How are you today? + + From e74063aec67b81e971ac7b8651aaa3d6c17b4e77 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 00:51:43 -0400 Subject: [PATCH 085/140] test WRAPPER Signed-off-by: Caleb Cushing --- t/templates/wrapper.tt | 3 +++ t/wrapper.t | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 t/templates/wrapper.tt create mode 100644 t/wrapper.t diff --git a/t/templates/wrapper.tt b/t/templates/wrapper.tt new file mode 100644 index 0000000..ec7c532 --- /dev/null +++ b/t/templates/wrapper.tt @@ -0,0 +1,3 @@ +Well, +[% content %] +It's a beatiful day. diff --git a/t/wrapper.t b/t/wrapper.t new file mode 100644 index 0000000..ff939aa --- /dev/null +++ b/t/wrapper.t @@ -0,0 +1,33 @@ +#!perl +use strict; +use warnings; +use Template::ShowStartStop; +use Template::Test; + +my $tt = Template->new({ + CONTEXT => Template::ShowStartStop->new, +}); + +my $vars = { + var => 'world', +}; + +test_expect(\*DATA, $tt, $vars); + +__DATA__ +--test-- +[% WRAPPER t/templates/wrapper.tt -%] +hello [% var %] +[%- END -%] +[% PROCESS t/templates/how.tt -%] +--expect-- + + +Well, +hello world +It's a beatiful day. + + +How are you today? + + From 92608feaa3234485e0531fccaef5bb6e98d63ce6 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 00:53:23 -0400 Subject: [PATCH 086/140] update changes Signed-off-by: Caleb Cushing --- Changes | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Changes b/Changes index 4df00b4..6b2e3d2 100644 --- a/Changes +++ b/Changes @@ -2,10 +2,9 @@ Revision history for Template::ShowStartStop {{$NEXT}} ==================================== * Change License to Artistic 2.0 because dual license isn't required -* add basic functionality test +* add more thorough tests * simplify documentation * add SubmittingPatches documentation -* add MetaTests 0.07 May 10 2010 ==================================== From e87cfb38898cb73892abd972e24f4f460951ab79 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 00:59:09 -0400 Subject: [PATCH 087/140] make output example more realistic Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index 694942d..82377b8 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -53,12 +53,17 @@ Using Template::ShowStartStop is simple. Now when you process templates, HTML comments will get embedded in your output, which you can easily grep for. The nesting level is also shown. - - - - .... - - + + + + + + ... + + + ... + + =head1 BUGS From 28dde6d507e4ff3549c287540736f9d9d9610633 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 01:03:21 -0400 Subject: [PATCH 088/140] v0.08 --- Changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changes b/Changes index 6b2e3d2..5bf677c 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for Template::ShowStartStop {{$NEXT}} + +0.08 May 27 2010 ==================================== * Change License to Artistic 2.0 because dual license isn't required * add more thorough tests From f213badd00258cad5f1bd3acd774e3342072f318 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 19:35:25 -0400 Subject: [PATCH 089/140] remove $sub the removal of $sub allows us to remove 'no strict refs' Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index 82377b8..4c2c2df 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -4,9 +4,7 @@ use warnings; package Template::ShowStartStop; use parent qw( Template::Context ); -my $sub = qw(process); - -my $super = __PACKAGE__->can("SUPER::$sub") or die; +my $super = __PACKAGE__->can('SUPER::process') or die; my $wrapped = sub { my $self = shift; @@ -22,15 +20,15 @@ my $wrapped = sub { my $processed_data = $super->($self, $what, @_); my $output - = "\n" + = "\n" . "$processed_data" - . "\n" + . "\n" ; return $output; }; -{ no strict 'refs'; *{$sub} = $wrapped; } +*{process} = $wrapped; 1; __END__ From 59dbd7dadd46ed862bc21649a4bb008d178811f8 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 19:55:37 -0400 Subject: [PATCH 090/140] add CriticTests Signed-off-by: Caleb Cushing --- dist.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/dist.ini b/dist.ini index a890639..5809aac 100644 --- a/dist.ini +++ b/dist.ini @@ -31,6 +31,7 @@ remove = Readme [MetaTests] [HasVersionTests] [DistManifestTests] +[CriticTests] [PruneFiles] filenames = dist.ini From 6caa9741211b919751fcaeabd36a7ae32d3f0e19 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 20:26:16 -0400 Subject: [PATCH 091/140] remove notes from irc conversation. most of the notes were implemented and thus don't need to be around anymore --- lib/Template/ShowStartStop.pm | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index 4c2c2df..f39cb6e 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -78,19 +78,3 @@ Bill Moseley, and to Gavin Estey for the original Template::Timer code that this is based on. =cut - -# notes from an IRC conversation on how to improve this module -[Tuesday 02 March 2010] [04:26:51 pm] xenoterracide: you can get rid -of foreach, since you only wrap one method, also drop my $super = ...;, remove -'no strict', change '*{$sub} = sub {' for 'my $wrappedSub = sub {', use 'my -$processed_data = $self->SUPER::process(...)', and at the end put { no strict -'refs'; *{'process'} = $wrappedSub; }. -[Tuesday 02 March 2010] [04:32:10 pm] tm604 would I still -need the foreach if I was still wrapping include? -[Tuesday 02 March 2010] [04:32:31 pm] xenoterracide: Not really, -because it's needless complexity for something that's just subclassing one or -two methods. -[Tuesday 02 March 2010] [04:32:49 pm] k -[Tuesday 02 March 2010] [04:35:08 pm] xenoterracide: Just put the -common code in a single sub, and have it call include or process as -appropriate. From 88a1121ad742cc51ce0ca21cbc4558b7e68f09fe Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 20:45:46 -0400 Subject: [PATCH 092/140] test multiple blocks in WRAPPER Signed-off-by: Caleb Cushing --- t/wrapper.t | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/t/wrapper.t b/t/wrapper.t index ff939aa..1b4bb36 100644 --- a/t/wrapper.t +++ b/t/wrapper.t @@ -4,6 +4,8 @@ use warnings; use Template::ShowStartStop; use Template::Test; +$Template::Test::DEBUG = 1; + my $tt = Template->new({ CONTEXT => Template::ShowStartStop->new, }); @@ -15,12 +17,12 @@ my $vars = { test_expect(\*DATA, $tt, $vars); __DATA__ ---test-- +-- test -- [% WRAPPER t/templates/wrapper.tt -%] hello [% var %] [%- END -%] [% PROCESS t/templates/how.tt -%] ---expect-- +-- expect -- Well, @@ -31,3 +33,14 @@ It's a beatiful day. How are you today? +-- test -- +[% BLOCK bold %][% content %][% END -%] +[% BLOCK italic %][% content %][% END -%] +[% WRAPPER bold+italic %]Hello World[% END -%] +-- expect -- + + + +Hello World + + From 33421f977d0b14355a6c833ee64f9254a98cfc9d Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 22:01:07 -0400 Subject: [PATCH 093/140] reformat for next patch this patch includes formatting changes only so they can't be confused with the functionality change of the next patch making it easier to read Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index f39cb6e..da92a7c 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -12,9 +12,9 @@ my $wrapped = sub { my $template # get the template filename # conditional # set $template to - = ref($what) eq 'ARRAY' ? join( ' + ', @{$what} ) - : ref($what) ? $what->name - : $what + = ref($what) eq 'ARRAY' ? join( ' + ', @{$what} ) + : ref($what) ? $what->name + : $what ; my $processed_data = $super->($self, $what, @_); From 0e48fbd7d432b3356d9758a2390aaa6aff7f33a1 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 22:03:36 -0400 Subject: [PATCH 094/140] allow for eval-ed blocks fixes Template::Timer bug #13225 Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index da92a7c..006a024 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -13,6 +13,7 @@ my $wrapped = sub { my $template # get the template filename # conditional # set $template to = ref($what) eq 'ARRAY' ? join( ' + ', @{$what} ) + : ref($what) eq 'SCALAR' ? '(evaluated block)' : ref($what) ? $what->name : $what ; From 2decf52b58379bea9448bd2d471aa6887207623a Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 22:05:47 -0400 Subject: [PATCH 095/140] add passing test for eval-ed blocks Signed-off-by: Caleb Cushing --- t/eval.t | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/t/eval.t b/t/eval.t index 92b09d4..35c24f4 100644 --- a/t/eval.t +++ b/t/eval.t @@ -1,26 +1,28 @@ -#!perl -T - +#!perl use strict; use warnings; +use Template::ShowStartStop; +use Template::Test; -use Test::More tests => 3; - -BEGIN { use_ok( 'Template' ); } -BEGIN { use_ok( 'Template::ShowStartStop' ); } +$Template::Test::DEBUG = 1; -my $tt = - Template->new( { - CONTEXT => Template::ShowStartStop->new - } ); +my $tt = Template->new({ + CONTEXT => Template::ShowStartStop->new, +}); -my $block = q{[% thing = 'doohickey' %]}; +my $vars = { + place => 'hat', + fragment => "The cat sat on the [% place %]\n", +}; -TODO: { # See RT # 13225 - local $TODO = 'Problem identified but not fixed'; - my $rc = $tt->process( \*DATA, { block => $block } ); - ok( $rc, 'eval' ); -} +test_expect(\*DATA, $tt, $vars); __DATA__ -[% block | eval %] -[% thing %] +-- test -- +[% fragment | eval -%] +-- expect -- + + +The cat sat on the hat + + From 5c3b84586906e1fdc2b40505c9690e5f91166e28 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 22:35:36 -0400 Subject: [PATCH 096/140] check for ref type Template::Document explicitly previously we only tested for this implicitly. if a template didn't match an ARRAY ref and was a ref it must be an Template::Document. Since this seems to be the most common ref type we test for it first as to short circuit. This should also prevent bugs like rt #13225 from blowing up our code in the future Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index 006a024..da6496d 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -10,14 +10,16 @@ my $wrapped = sub { my $self = shift; my $what = shift; # what template are we working with - my $template # get the template filename - # conditional # set $template to - = ref($what) eq 'ARRAY' ? join( ' + ', @{$what} ) - : ref($what) eq 'SCALAR' ? '(evaluated block)' - : ref($what) ? $what->name - : $what + my $template + # conditional # set $template to + = ref($what) eq 'Template::Document' ? $what->name + : ref($what) eq 'ARRAY' ? join( ' + ', @{$what} ) + : ref($what) eq 'SCALAR' ? '(evaluated block)' + : $what ; + my $ref = ref($what); + my $processed_data = $super->($self, $what, @_); my $output From debc6f388ea3075dcc5b17d6127f7a7a56b70df3 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 23:08:27 -0400 Subject: [PATCH 097/140] remove unused variable I used the code to determine what type of ref I was looking at and accidentally commited it. add test to make sure it doesn't happen again Signed-off-by: Caleb Cushing --- dist.ini | 1 + lib/Template/ShowStartStop.pm | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dist.ini b/dist.ini index 5809aac..69d8b3b 100644 --- a/dist.ini +++ b/dist.ini @@ -32,6 +32,7 @@ remove = Readme [HasVersionTests] [DistManifestTests] [CriticTests] +[UnusedVarsTests] [PruneFiles] filenames = dist.ini diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index da6496d..80c1027 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -18,8 +18,6 @@ my $wrapped = sub { : $what ; - my $ref = ref($what); - my $processed_data = $super->($self, $what, @_); my $output From a40319be2c4a53b250f490080f5454277ef86391 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 23:24:27 -0400 Subject: [PATCH 098/140] remove __END__ Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index 80c1027..b4f0ec3 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -32,7 +32,6 @@ my $wrapped = sub { *{process} = $wrapped; 1; -__END__ # ABSTRACT: Display where template's start and stop =head1 SYNOPSIS From 22da821ca73c8a25de2278a905d1c97488c345a5 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 27 May 2010 23:51:57 -0400 Subject: [PATCH 099/140] test PROCESS blocks with more than 1 file this adds a test for PROCESS blocks with more than one file. see Template::Timer rt bug #13366 Signed-off-by: Caleb Cushing --- t/process.t | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/t/process.t b/t/process.t index 57d3387..cb833ed 100644 --- a/t/process.t +++ b/t/process.t @@ -25,3 +25,14 @@ hello world How are you today? +-- test -- +[% PROCESS t/templates/how.tt + t/templates/wrapper.tt -%] +-- expect -- + + +How are you today? +Well, + +It's a beatiful day. + + From 3daae48342467fdfd95011ba4d03baa01a4ffa3c Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 28 May 2010 00:02:20 -0400 Subject: [PATCH 100/140] fix uri Signed-off-by: Caleb Cushing --- SubmittingPatches | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SubmittingPatches b/SubmittingPatches index 4963fca..2f6109e 100644 --- a/SubmittingPatches +++ b/SubmittingPatches @@ -337,7 +337,7 @@ One test you could do yourself if your MUA is set up correctly is: * Try to apply to the tip of the "master" branch from the git.git public repository: - $ git fetch http://kernel.org/pub/scm/git/git.git master:test-apply + $ git fetch git://github.com/xenoterracide/Template-ShowStartStop.git master:test-apply $ git checkout test-apply $ git reset --hard $ git am a.patch From ec75cec17a79d1ccec71c7f8427eaf2d321b1ba1 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 28 May 2010 00:46:30 -0400 Subject: [PATCH 101/140] add Kwalitee tests Signed-off-by: Caleb Cushing --- dist.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/dist.ini b/dist.ini index 69d8b3b..32aeb2e 100644 --- a/dist.ini +++ b/dist.ini @@ -33,6 +33,7 @@ remove = Readme [DistManifestTests] [CriticTests] [UnusedVarsTests] +[KwaliteeTests] [PruneFiles] filenames = dist.ini From f13da29d43d117a46b9ee96448d68b055c7464b4 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 28 May 2010 00:50:22 -0400 Subject: [PATCH 102/140] reformat changes Signed-off-by: Caleb Cushing --- Changes | 54 +++++++++++++++++++++++------------------------------- 1 file changed, 23 insertions(+), 31 deletions(-) diff --git a/Changes b/Changes index 5bf677c..7b1d0c3 100644 --- a/Changes +++ b/Changes @@ -2,38 +2,30 @@ Revision history for Template::ShowStartStop {{$NEXT}} 0.08 May 27 2010 -==================================== -* Change License to Artistic 2.0 because dual license isn't required -* add more thorough tests -* simplify documentation -* add SubmittingPatches documentation + - Change License to Artistic 2.0 because dual license isn't required + - add more thorough tests + - simplify documentation + - add SubmittingPatches documentation 0.07 May 10 2010 -==================================== -Fix Licensing Issues + - Fix Licensing Issues 0.06 May 10 2010 -==================================== -Migrate completely to Dist::Zilla - -0.05 Apr 26 2010 -==================================== -change back to ternary. -remove foreach. -use Dist::Zilla for packaging - -0.04 Mar 1 2010 -==================================== -change from heredoc. I think it's sloppy - -0.03 Feb 15 2010 -==================================== -Clean up files for wrong comments - -0.02 Jan 26 2010 -==================================== -Show process only comments to remove redunancy - -0.01 Jan 25 2010 -==================================== -First rudimentary version. Patches and comments welcome. + - Migrate completely to Dist::Zilla + +0.05 Apr 26 2010 + - change back to ternary. + - remove foreach. + - use Dist::Zilla for packaging + +0.04 Mar 1 2010 + - change from heredoc. I think it's sloppy + +0.03 Feb 15 2010 + - Clean up files for wrong comments + +0.02 Jan 26 2010 + - Show process only comments to remove redunancy + +0.01 Jan 25 2010 + - First rudimentary version. Patches and comments welcome. From 6c1f3891344997237841ba4d46e0c8a570067670 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 28 May 2010 01:11:41 -0400 Subject: [PATCH 103/140] add Prepender this adds a copyright notice to the top of all files Signed-off-by: Caleb Cushing --- dist.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/dist.ini b/dist.ini index 32aeb2e..d59ec2e 100644 --- a/dist.ini +++ b/dist.ini @@ -17,6 +17,7 @@ remove = Readme [PkgVersion] [PodWeaver] [Repository] +[Prepender] [NextRelease] format = %-9v %{MMM dd yyyy}d From 3c96715e8f042423f07c13408afdf83a54aefeae Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 28 May 2010 01:38:01 -0400 Subject: [PATCH 104/140] add Metadata with MetaResources Signed-off-by: Caleb Cushing --- dist.ini | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dist.ini b/dist.ini index d59ec2e..0b660c1 100644 --- a/dist.ini +++ b/dist.ini @@ -5,6 +5,11 @@ author = Caleb Cushing license = Artistic_2_0 copyright_holder = Caleb Cushing +[MetaResources] +bugtracker.web = http://github.com/xenoterracide/Template-ShowStartStop/issues +repository.web = http://github.com/xenoterracide/Template-ShowStartStop +repository.type = git + [ReadmeFromPod] [@Filter] bundle = @Basic From b1eda734520cda8bfe97e537a385c9addf29bc40 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 28 May 2010 02:06:59 -0400 Subject: [PATCH 105/140] bump version to 0.09 Signed-off-by: Caleb Cushing --- dist.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist.ini b/dist.ini index 0b660c1..ee44c10 100644 --- a/dist.ini +++ b/dist.ini @@ -1,6 +1,6 @@ name = Template-ShowStartStop abstract = Display where template's start and stop -version = 0.08 +version = 0.09 author = Caleb Cushing license = Artistic_2_0 copyright_holder = Caleb Cushing From 41c160495ca9d1dfee42ea6a95e77a7bd64f6489 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 28 May 2010 02:14:13 -0400 Subject: [PATCH 106/140] v0.09 - fix bug #13225 for T:SSS - refactor code - add more tests Signed-off-by: Caleb Cushing --- Changes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Changes b/Changes index 7b1d0c3..864dff1 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,11 @@ Revision history for Template::ShowStartStop {{$NEXT}} +0.09 May 28 2010 + - fix bug #13225 for T:SSS + - refactor code + - add more tests + 0.08 May 27 2010 - Change License to Artistic 2.0 because dual license isn't required - add more thorough tests From ddf3a8956f6df55022853f137594826cf4d6d706 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 28 May 2010 02:50:13 -0400 Subject: [PATCH 107/140] spelling correction Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index b4f0ec3..d1371b0 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -43,7 +43,7 @@ my $wrapped = sub { =head1 DESCRIPTION -Template::ShowStartStop provides inline comments througout your code where +Template::ShowStartStop provides inline comments throughout your code where each template stops and starts. It's an overridden version of L that wraps the C method. From 2aefe5efb1177aea980ed9626ba3be3cff04c01c Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 28 May 2010 16:00:42 -0400 Subject: [PATCH 108/140] pod documentation referring to SubmittingPatches I don't want people to accidently miss my documentation so let's make sure it's referenced in the first docs they look at. Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index d1371b0..a24b0c4 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -69,6 +69,12 @@ Please report any bugs or feature requests on L as I'm not fond of RT. +=head1 SUBMITTING PATCHES + +Please read the SubmittingPatches file included with this Distribution. Patches +that are of sufficient quality, within the goals of the project and pass the +checklist will be accepted. + =head1 ACKNOWLEDGEMENTS Thanks to From fe90f189f694c02f61a5c5bb43c48ae0b5f0dd91 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 28 May 2010 18:23:57 -0400 Subject: [PATCH 109/140] non-commital I may have other reasons for not accepting a patch and I reserve the right not to accept a patch for any reason Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index a24b0c4..a0d748e 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -73,7 +73,7 @@ as I'm not fond of RT. Please read the SubmittingPatches file included with this Distribution. Patches that are of sufficient quality, within the goals of the project and pass the -checklist will be accepted. +checklist will probably be accepted. =head1 ACKNOWLEDGEMENTS From fcbc8224103214156979ca522acc1f3bc800d66b Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 28 May 2010 18:49:23 -0400 Subject: [PATCH 110/140] policy change: supply new tests if needed We don't actually want people adding functionality or fixing a bug unless they can also provide a test for it. Signed-off-by: Caleb Cushing --- SubmittingPatches | 1 + 1 file changed, 1 insertion(+) diff --git a/SubmittingPatches b/SubmittingPatches index 2f6109e..15bb5a4 100644 --- a/SubmittingPatches +++ b/SubmittingPatches @@ -20,6 +20,7 @@ Checklist (and a short version for the impatient): Certificate of Origin - make sure that you have tests for the bug you are fixing - make sure that the test suite passes after your commit + - make sure that you provide any new tests needed - make sure that you provide documentation for any features Patch: From d0bd633bc8791ab00b2ef6f32626269e79df3ba7 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 28 May 2010 18:59:09 -0400 Subject: [PATCH 111/140] Revert "policy change: supply new tests if needed" This reverts commit fcbc8224103214156979ca522acc1f3bc800d66b. this was already in the wording, oops. Signed-off-by: Caleb Cushing --- SubmittingPatches | 1 - 1 file changed, 1 deletion(-) diff --git a/SubmittingPatches b/SubmittingPatches index 15bb5a4..2f6109e 100644 --- a/SubmittingPatches +++ b/SubmittingPatches @@ -20,7 +20,6 @@ Checklist (and a short version for the impatient): Certificate of Origin - make sure that you have tests for the bug you are fixing - make sure that the test suite passes after your commit - - make sure that you provide any new tests needed - make sure that you provide documentation for any features Patch: From 342c4caa06b9d795c419dd7818b2e9c28828c376 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 28 May 2010 19:03:33 -0400 Subject: [PATCH 112/140] clean up from git.git some of this file that's in the git.git repo is not necessary or correct for my perl projects. This is further cleanup Signed-off-by: Caleb Cushing --- SubmittingPatches | 362 +++------------------------------------------- 1 file changed, 20 insertions(+), 342 deletions(-) diff --git a/SubmittingPatches b/SubmittingPatches index 2f6109e..c721bac 100644 --- a/SubmittingPatches +++ b/SubmittingPatches @@ -20,34 +20,29 @@ Checklist (and a short version for the impatient): Certificate of Origin - make sure that you have tests for the bug you are fixing - make sure that the test suite passes after your commit - - make sure that you provide documentation for any features Patch: - use "git format-patch -M" to create the patch - do not PGP sign your patch - - do not attach your patch, but read in the mail - body, unless you cannot teach your mailer to - leave the formatting of the patch alone. - - be careful doing cut & paste into your mailer, not to - corrupt whitespaces. + - be careful doing cut & paste, not to corrupt whitespaces. - provide additional information (which is unsuitable for the commit message) between the "---" and the diffstat - - if you change, add, or remove a command line option or + - if you change, add, or remove any features or make some other user interface change, the associated documentation should be updated as well. - if your name is not writable in ASCII, make sure that - you send off a message in the correct encoding. + you send the patch in the correct encoding. Long version: -I started reading over the SubmittingPatches document for Linux -kernel, primarily because I wanted to have a document similar to -it for the core GIT to make sure people understand what they are -doing when they write "Signed-off-by" line. +I started reading over the SubmittingPatches document for git, +primarily because I wanted to have a document similar to it for +my projects to make sure people understand what they are doing +when they write "Signed-off-by" line. But the patch submission requirements are a lot more relaxed -here on the technical/contents front, because the core GIT is +here on the technical/contents front, because my projects are thousand times smaller ;-). So here is only the relevant bits. (0) Decide what to base your work on. @@ -105,20 +100,6 @@ changes do not trigger errors with the sample pre-commit hook shipped in templates/hooks--pre-commit. To help ensure this does not happen, run git diff --check on your changes before you commit. - -(1a) Try to be nice to older C compilers - -We try to support a wide range of C compilers to compile -git with. That means that you should not use C99 initializers, even -if a lot of compilers grok it. - -Also, variables have to be declared at the beginning of the block -(you can check this with gcc, using the -Wdeclaration-after-statement -option). - -Another thing: NULL pointers shall be written as NULL, not as 0. - - (2) Generate your patch using git tools out of your commits. git based diff tools (git, Cogito, and StGIT included) generate @@ -139,11 +120,7 @@ that is fine, but please mark it as such. (3) Sending your patches. People need to be able to read and comment on the changes you are -submitting. It is important for a developer to be able to "quote" -your changes, using standard e-mail tools, so that they may comment -on specific portions of your code. For this reason, all patches -should be submitted "inline". WARNING: Be wary of your MUAs word-wrap -corrupting your patch. Do not cut-n-paste your patch; you can lose +submitting. Do not cut-n-paste your patch; you can lose tabs that way if you are not careful. It is a common convention to prefix your subject line with @@ -155,33 +132,10 @@ not ready to be applied but it is for discussion, [PATCH v2], [PATCH v3] etc. are often seen when you are sending an update to what you have previously sent. -"git format-patch" command follows the best current practice to -format the body of an e-mail message. At the beginning of the -patch should come your commit message, ending with the -Signed-off-by: lines, and a line that consists of three dashes, -followed by the diffstat information and the patch itself. If -you are forwarding a patch from somebody else, optionally, at -the beginning of the e-mail message just before the commit -message starts, you can put a "From: " line to name that person. - You often want to add additional explanation about the patch, other than the commit message itself. Place such "cover letter" material between the three dash lines and the diffstat. -Do not attach the patch as a MIME attachment, compressed or not. -Do not let your e-mail client send quoted-printable. Do not let -your e-mail client send format=flowed which would destroy -whitespaces in your patches. Many -popular e-mail applications will not always transmit a MIME -attachment as plain text, making it impossible to comment on -your code. A MIME attachment also takes a bit more time to -process. This does not decrease the likelihood of your -MIME-attached change being accepted, but it makes it more likely -that it will be postponed. - -Exception: If your mailer is mangling patches then someone may ask -you to re-send them using MIME, that is OK. - Do not PGP sign your patch, at least for now. Most likely, your maintainer or other people on the list would not have your PGP key and would not bother obtaining it anyway. Your patch is not @@ -210,8 +164,8 @@ necessary. To improve tracking of who did what, we've borrowed the "sign-off" procedure from the Linux kernel project on patches -that are being emailed around. Although core GIT is a lot -smaller project it is a good discipline to follow it. +that are being emailed around. Although this project is a lot +smaller it is a good discipline to follow it. The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have @@ -238,11 +192,11 @@ pretty simple: if you can certify the below: person who certified (a), (b) or (c) and I have not modified it. - (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. + (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. then you just add a line saying @@ -253,9 +207,7 @@ command with the -s option. Notice that you can place your own Signed-off-by: line when forwarding somebody else's patch with the above rules for -D-C-O. Indeed you are encouraged to do so. Do not forget to -place an in-body "From: " line at the beginning to properly attribute -the change to its true author (see (2) above). +D-C-O. Indeed you are encouraged to do so. Also notice that a real name is used in the Signed-off-by: line. Please don't hide your real name. @@ -288,13 +240,10 @@ suggests to the contributors: (2) You get comments and suggestions for improvements. You may even get them in a "on top of your change" patch form. - (3) Polish, refine, and re-send to the list and the people who - spend their time to improve your patch. Go back to step (2). + (3) Polish, refine, and re-send to the the people who spend their + time to improve your patch. Go back to step (2). - (4) The list forms consensus that the last round of your patch is - good. Send it to the list and cc the maintainer. - - (5) A topic branch is created with the patch and is merged to 'next', + (4) A topic branch is created with the patch and is merged to 'next', and cooked further and eventually graduates to 'master'. In any time between the (2)-(3) cycle, the maintainer may pick it up @@ -311,274 +260,3 @@ Know the status of your patch after submission of the branch in which your patch has been merged (i.e. it will not tell you if your patch is merged in pu if you rebase on top of master). - ------------------------------------------------- -MUA specific hints - -Some of patches I receive or pick up from the list share common -patterns of breakage. Please make sure your MUA is set up -properly not to corrupt whitespaces. Here are two common ones -I have seen: - -* Empty context lines that do not have _any_ whitespace. - -* Non empty context lines that have one extra whitespace at the - beginning. - -One test you could do yourself if your MUA is set up correctly is: - -* Send the patch to yourself, exactly the way you would, except - To: and Cc: lines, which would not contain the list and - maintainer address. - -* Save that patch to a file in UNIX mailbox format. Call it say - a.patch. - -* Try to apply to the tip of the "master" branch from the - git.git public repository: - - $ git fetch git://github.com/xenoterracide/Template-ShowStartStop.git master:test-apply - $ git checkout test-apply - $ git reset --hard - $ git am a.patch - -If it does not apply correctly, there can be various reasons. - -* Your patch itself does not apply cleanly. That is _bad_ but - does not have much to do with your MUA. Please rebase the - patch appropriately. - -* Your MUA corrupted your patch; "am" would complain that - the patch does not apply. Look at .git/rebase-apply/ subdirectory and - see what 'patch' file contains and check for the common - corruption patterns mentioned above. - -* While you are at it, check what are in 'info' and - 'final-commit' files as well. If what is in 'final-commit' is - not exactly what you would want to see in the commit log - message, it is very likely that your maintainer would end up - hand editing the log message when he applies your patch. - Things like "Hi, this is my first patch.\n", if you really - want to put in the patch e-mail, should come after the - three-dash line that signals the end of the commit message. - - -Pine ----- - -(Johannes Schindelin) - -I don't know how many people still use pine, but for those poor -souls it may be good to mention that the quell-flowed-text is -needed for recent versions. - -... the "no-strip-whitespace-before-send" option, too. AFAIK it -was introduced in 4.60. - -(Linus Torvalds) - -And 4.58 needs at least this. - ---- -diff-tree 8326dd8350be64ac7fc805f6563a1d61ad10d32c (from e886a61f76edf5410573e92e38ce22974f9c40f1) -Author: Linus Torvalds -Date: Mon Aug 15 17:23:51 2005 -0700 - - Fix pine whitespace-corruption bug - - There's no excuse for unconditionally removing whitespace from - the pico buffers on close. - -diff --git a/pico/pico.c b/pico/pico.c ---- a/pico/pico.c -+++ b/pico/pico.c -@@ -219,7 +219,9 @@ PICO *pm; - switch(pico_all_done){ /* prepare for/handle final events */ - case COMP_EXIT : /* already confirmed */ - packheader(); -+#if 0 - stripwhitespace(); -+#endif - c |= COMP_EXIT; - break; - - -(Daniel Barkalow) - -> A patch to SubmittingPatches, MUA specific help section for -> users of Pine 4.63 would be very much appreciated. - -Ah, it looks like a recent version changed the default behavior to do the -right thing, and inverted the sense of the configuration option. (Either -that or Gentoo did it.) So you need to set the -"no-strip-whitespace-before-send" option, unless the option you have is -"strip-whitespace-before-send", in which case you should avoid checking -it. - - -Thunderbird ------------ - -(A Large Angry SCM) - -By default, Thunderbird will both wrap emails as well as flag them as -being 'format=flowed', both of which will make the resulting email unusable -by git. - -Here are some hints on how to successfully submit patches inline using -Thunderbird. - -There are two different approaches. One approach is to configure -Thunderbird to not mangle patches. The second approach is to use -an external editor to keep Thunderbird from mangling the patches. - -Approach #1 (configuration): - -This recipe is current as of Thunderbird 2.0.0.19. Three steps: - 1. Configure your mail server composition as plain text - Edit...Account Settings...Composition & Addressing, - uncheck 'Compose Messages in HTML'. - 2. Configure your general composition window to not wrap - Edit..Preferences..Composition, wrap plain text messages at 0 - 3. Disable the use of format=flowed - Edit..Preferences..Advanced..Config Editor. Search for: - mailnews.send_plaintext_flowed - toggle it to make sure it is set to 'false'. - -After that is done, you should be able to compose email as you -otherwise would (cut + paste, git-format-patch | git-imap-send, etc), -and the patches should not be mangled. - -Approach #2 (external editor): - -This recipe appears to work with the current [*1*] Thunderbird from Suse. - -The following Thunderbird extensions are needed: - AboutConfig 0.5 - http://aboutconfig.mozdev.org/ - External Editor 0.7.2 - http://globs.org/articles.php?lng=en&pg=8 - -1) Prepare the patch as a text file using your method of choice. - -2) Before opening a compose window, use Edit->Account Settings to -uncheck the "Compose messages in HTML format" setting in the -"Composition & Addressing" panel of the account to be used to send the -patch. [*2*] - -3) In the main Thunderbird window, _before_ you open the compose window -for the patch, use Tools->about:config to set the following to the -indicated values: - mailnews.send_plaintext_flowed => false - mailnews.wraplength => 0 - -4) Open a compose window and click the external editor icon. - -5) In the external editor window, read in the patch file and exit the -editor normally. - -6) Back in the compose window: Add whatever other text you wish to the -message, complete the addressing and subject fields, and press send. - -7) Optionally, undo the about:config/account settings changes made in -steps 2 & 3. - - -[Footnotes] -*1* Version 1.0 (20041207) from the MozillaThunderbird-1.0-5 rpm of Suse -9.3 professional updates. - -*2* It may be possible to do this with about:config and the following -settings but I haven't tried, yet. - mail.html_compose => false - mail.identity.default.compose_html => false - mail.identity.id?.compose_html => false - -(Lukas Sandström) - -There is a script in contrib/thunderbird-patch-inline which can help -you include patches with Thunderbird in an easy way. To use it, do the -steps above and then use the script as the external editor. - -Gnus ----- - -'|' in the *Summary* buffer can be used to pipe the current -message to an external program, and this is a handy way to drive -"git am". However, if the message is MIME encoded, what is -piped into the program is the representation you see in your -*Article* buffer after unwrapping MIME. This is often not what -you would want for two reasons. It tends to screw up non ASCII -characters (most notably in people's names), and also -whitespaces (fatal in patches). Running 'C-u g' to display the -message in raw form before using '|' to run the pipe can work -this problem around. - - -KMail ------ - -This should help you to submit patches inline using KMail. - -1) Prepare the patch as a text file. - -2) Click on New Mail. - -3) Go under "Options" in the Composer window and be sure that -"Word wrap" is not set. - -4) Use Message -> Insert file... and insert the patch. - -5) Back in the compose window: add whatever other text you wish to the -message, complete the addressing and subject fields, and press send. - - -Gmail ------ - -GMail does not appear to have any way to turn off line wrapping in the web -interface, so this will mangle any emails that you send. You can however -use "git send e-mail" and send your patches through the GMail SMTP server, or -use any IMAP email client to connect to the google IMAP server and forward -the emails through that. - -To use "git send-email" and send your patches through the GMail SMTP server, -edit ~/.gitconfig to specify your account settings: - -[sendemail] - smtpencryption = tls - smtpserver = smtp.gmail.com - smtpuser = user@gmail.com - smtppass = p4ssw0rd - smtpserverport = 587 - -Once your commits are ready to be sent to the mailing list, run the -following commands: - - $ git format-patch --cover-letter -M origin/master -o outgoing/ - $ edit outgoing/0000-* - $ git send-email outgoing/* - -To submit using the IMAP interface, first, edit your ~/.gitconfig to specify your -account settings: - -[imap] - folder = "[Gmail]/Drafts" - host = imaps://imap.gmail.com - user = user@gmail.com - pass = p4ssw0rd - port = 993 - sslverify = false - -You might need to instead use: folder = "[Google Mail]/Drafts" if you get an error -that the "Folder doesn't exist". - -Once your commits are ready to be sent to the mailing list, run the -following commands: - - $ git format-patch --cover-letter -M --stdout origin/master | git imap-send - -Just make sure to disable line wrapping in the email client (GMail web -interface will line wrap no matter what, so you need to use a real -IMAP client). - From b8de7eedd7adc23a297242ba9bf573123f96cfc3 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 2 Jun 2010 18:28:03 -0400 Subject: [PATCH 113/140] don't seperate GatherDir from @Basic anymore was using this to customize GatherDir but that's not longer needed Signed-off-by: Caleb Cushing --- dist.ini | 2 -- 1 file changed, 2 deletions(-) diff --git a/dist.ini b/dist.ini index ee44c10..ac12400 100644 --- a/dist.ini +++ b/dist.ini @@ -13,10 +13,8 @@ repository.type = git [ReadmeFromPod] [@Filter] bundle = @Basic -remove = GatherDir remove = Readme -[GatherDir] [AutoPrereq] [PkgVersion] From 792154ce785d302a35146148d2998ce07ccd9d5e Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 2 Jun 2010 18:57:29 -0400 Subject: [PATCH 114/140] add more repository info Signed-off-by: Caleb Cushing --- dist.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/dist.ini b/dist.ini index ac12400..fdca53e 100644 --- a/dist.ini +++ b/dist.ini @@ -8,6 +8,7 @@ copyright_holder = Caleb Cushing [MetaResources] bugtracker.web = http://github.com/xenoterracide/Template-ShowStartStop/issues repository.web = http://github.com/xenoterracide/Template-ShowStartStop +repository.url = git://github.com/xenoterracide/Template-ShowStartStop.git repository.type = git [ReadmeFromPod] From 72559daf6264eaeb7df09eecc3a4fd1f0bfee7ea Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Thu, 3 Jun 2010 00:08:21 -0400 Subject: [PATCH 115/140] remove typeglob just call sub this is uneeded complexity since we are no longer calling more than one sub Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index a0d748e..c3260df 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -6,7 +6,7 @@ use parent qw( Template::Context ); my $super = __PACKAGE__->can('SUPER::process') or die; -my $wrapped = sub { +sub process { my $self = shift; my $what = shift; # what template are we working with @@ -29,8 +29,6 @@ my $wrapped = sub { return $output; }; -*{process} = $wrapped; - 1; # ABSTRACT: Display where template's start and stop =head1 SYNOPSIS From 8871a5f1e7fa863158eb01beffe2aba01b22fc5d Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 8 Jun 2010 00:53:05 -0400 Subject: [PATCH 116/140] rename variables to make more sense $what is actually the template. while $template is a way of identifying it Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index c3260df..d99a3da 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -8,22 +8,22 @@ my $super = __PACKAGE__->can('SUPER::process') or die; sub process { my $self = shift; - my $what = shift; # what template are we working with + my $template = shift; - my $template + my $template_id # conditional # set $template to - = ref($what) eq 'Template::Document' ? $what->name - : ref($what) eq 'ARRAY' ? join( ' + ', @{$what} ) - : ref($what) eq 'SCALAR' ? '(evaluated block)' - : $what + = ref($template) eq 'Template::Document' ? $template->name + : ref($template) eq 'ARRAY' ? join( ' + ', @{$template} ) + : ref($template) eq 'SCALAR' ? '(evaluated block)' + : $template ; - my $processed_data = $super->($self, $what, @_); + my $processed_data = $super->($self, $template, @_); my $output - = "\n" + = "\n" . "$processed_data" - . "\n" + . "\n" ; return $output; From 1739f531b676ef243dd469c6a2b984f45acad5d4 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 8 Jun 2010 01:34:38 -0400 Subject: [PATCH 117/140] don't check SUPER can instead call directly yet another simplification curtousy of khisanth Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index d99a3da..814d351 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -4,8 +4,6 @@ use warnings; package Template::ShowStartStop; use parent qw( Template::Context ); -my $super = __PACKAGE__->can('SUPER::process') or die; - sub process { my $self = shift; my $template = shift; @@ -18,7 +16,7 @@ sub process { : $template ; - my $processed_data = $super->($self, $template, @_); + my $processed_data = $self->SUPER::process( $template, @_ ); my $output = "\n" From 127db251ce26315cb1ed858a694c2c4f8cac67a7 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 8 Jun 2010 01:57:27 -0400 Subject: [PATCH 118/140] v0.10 - refactor code --- Changes | 2 ++ dist.ini | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 864dff1..f8dff9c 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,8 @@ Revision history for Template::ShowStartStop {{$NEXT}} +0.10 Jun 08 2010 + - refactor code 0.09 May 28 2010 - fix bug #13225 for T:SSS - refactor code diff --git a/dist.ini b/dist.ini index fdca53e..a695443 100644 --- a/dist.ini +++ b/dist.ini @@ -1,6 +1,6 @@ name = Template-ShowStartStop abstract = Display where template's start and stop -version = 0.09 +version = 0.10 author = Caleb Cushing license = Artistic_2_0 copyright_holder = Caleb Cushing From 7eff146b197c13401576483eb73b87956c6ea3ff Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 8 Jun 2010 03:47:58 -0400 Subject: [PATCH 119/140] insert empty line for readability Signed-off-by: Caleb Cushing --- Changes | 1 + 1 file changed, 1 insertion(+) diff --git a/Changes b/Changes index f8dff9c..4f4b93f 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,7 @@ Revision history for Template::ShowStartStop 0.10 Jun 08 2010 - refactor code + 0.09 May 28 2010 - fix bug #13225 for T:SSS - refactor code From bb55cde7280788ae1d90e777a7a38f27a11d664d Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 8 Jun 2010 19:11:12 -0400 Subject: [PATCH 120/140] conflicts with recent version of dzil Repository Plugin isn't actually needed we can just specify them using MetaResources [@Filter/MetaYAML] Invalid META structure. Errors found: [@Filter/MetaYAML] '' for 'url' is not a valid URL. (resources -> repository -> url) [Validation: 2] at /usr/lib/perl5/vendor_perl/Moose/Meta/Method/Delegation.pm line 108 Signed-off-by: Caleb Cushing --- dist.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/dist.ini b/dist.ini index a695443..f06dbf1 100644 --- a/dist.ini +++ b/dist.ini @@ -20,7 +20,6 @@ remove = Readme [PkgVersion] [PodWeaver] -[Repository] [Prepender] [NextRelease] From 0e1fd0266325254d0b2188be8974aed1217889e4 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 8 Jun 2010 19:36:05 -0400 Subject: [PATCH 121/140] prepend strict and warnings Signed-off-by: Caleb Cushing --- dist.ini | 2 ++ lib/Template/ShowStartStop.pm | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dist.ini b/dist.ini index f06dbf1..020a9e4 100644 --- a/dist.ini +++ b/dist.ini @@ -21,6 +21,8 @@ remove = Readme [PkgVersion] [PodWeaver] [Prepender] +line = use strict; +line = use warnings; [NextRelease] format = %-9v %{MMM dd yyyy}d diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index 814d351..7507a07 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -1,6 +1,3 @@ -use strict; -use warnings; - package Template::ShowStartStop; use parent qw( Template::Context ); From fc12a9f3eab041c940a9eda76fffb6d8df0fd4e6 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 8 Jun 2010 20:00:29 -0400 Subject: [PATCH 122/140] convert to Moose Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index 7507a07..cef63cd 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -1,9 +1,12 @@ package Template::ShowStartStop; -use parent qw( Template::Context ); +use Moose; +use namespace::autoclean; -sub process { +extends 'Template::Context'; + +override 'process' => sub { my $self = shift; - my $template = shift; + my ( $template ) = @_; my $template_id # conditional # set $template to @@ -13,7 +16,7 @@ sub process { : $template ; - my $processed_data = $self->SUPER::process( $template, @_ ); + my $processed_data = super(); my $output = "\n" @@ -23,7 +26,7 @@ sub process { return $output; }; - +__PACKAGE__->meta->make_immutable(inline_constructor => 0); 1; # ABSTRACT: Display where template's start and stop =head1 SYNOPSIS From f08c8608ec264a49c3e0e6543f3867f5d53d3290 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 9 Jun 2010 00:18:06 -0400 Subject: [PATCH 123/140] v0.11 - Moosify T:SSS --- Changes | 3 +++ dist.ini | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 4f4b93f..7345e43 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,9 @@ Revision history for Template::ShowStartStop {{$NEXT}} +0.11 Jun 09 2010 + - Moosify T:SSS + 0.10 Jun 08 2010 - refactor code diff --git a/dist.ini b/dist.ini index 020a9e4..b69de75 100644 --- a/dist.ini +++ b/dist.ini @@ -1,6 +1,6 @@ name = Template-ShowStartStop abstract = Display where template's start and stop -version = 0.10 +version = 0.11 author = Caleb Cushing license = Artistic_2_0 copyright_holder = Caleb Cushing From 2d4dbe25360551d79b4c7b91827c62d3c474581c Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Wed, 9 Jun 2010 19:49:03 -0400 Subject: [PATCH 124/140] correct grammar error Signed-off-by: Caleb Cushing --- dist.ini | 2 +- lib/Template/ShowStartStop.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist.ini b/dist.ini index b69de75..4f58b4f 100644 --- a/dist.ini +++ b/dist.ini @@ -1,5 +1,5 @@ name = Template-ShowStartStop -abstract = Display where template's start and stop +abstract = Display where templates start and stop version = 0.11 author = Caleb Cushing license = Artistic_2_0 diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index cef63cd..d4973d9 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -28,7 +28,7 @@ override 'process' => sub { }; __PACKAGE__->meta->make_immutable(inline_constructor => 0); 1; -# ABSTRACT: Display where template's start and stop +# ABSTRACT: Display where templates start and stop =head1 SYNOPSIS use Template::ShowStartStop; From 9ff0f3303d2d9b472745fdfbdad3228cac2de611 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 8 Jun 2010 02:57:39 -0400 Subject: [PATCH 125/140] remove unnecessary line Signed-off-by: Caleb Cushing --- dist.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/dist.ini b/dist.ini index 4f58b4f..f5b70b4 100644 --- a/dist.ini +++ b/dist.ini @@ -50,4 +50,3 @@ push_to = my tag_format = %v [Git::CommitBuild] -[Git::Check] From c42a879bfe0bd832423b35fef7329a07446a54f2 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 8 Jun 2010 04:12:03 -0400 Subject: [PATCH 126/140] add EOLTests Signed-off-by: Caleb Cushing --- dist.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/dist.ini b/dist.ini index f5b70b4..af8e04f 100644 --- a/dist.ini +++ b/dist.ini @@ -40,6 +40,7 @@ line = use warnings; [CriticTests] [UnusedVarsTests] [KwaliteeTests] +[EOLTests] [PruneFiles] filenames = dist.ini From d9607ae889fb8ab175c97105293f185e8fc47e23 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Fri, 11 Jun 2010 06:30:20 -0400 Subject: [PATCH 127/140] use Submitting patches module to generate that doc Signed-off-by: Caleb Cushing --- SubmittingPatches | 262 ---------------------------------------------- dist.ini | 1 + 2 files changed, 1 insertion(+), 262 deletions(-) delete mode 100644 SubmittingPatches diff --git a/SubmittingPatches b/SubmittingPatches deleted file mode 100644 index c721bac..0000000 --- a/SubmittingPatches +++ /dev/null @@ -1,262 +0,0 @@ -Checklist (and a short version for the impatient): - - Commits: - - - make commits of logical units - - check for unnecessary whitespace with "git diff --check" - before committing - - do not check in commented out code or unneeded files - - the first line of the commit message should be a short - description and should skip the full stop - - the body should provide a meaningful commit message, which: - - uses the imperative, present tense: "change", - not "changed" or "changes". - - includes motivation for the change, and contrasts - its implementation with previous behaviour - - if you want your work included in the main repository, add a - "Signed-off-by: Your Name " line to the - commit message (or just use the option "-s" when - committing) to confirm that you agree to the Developer's - Certificate of Origin - - make sure that you have tests for the bug you are fixing - - make sure that the test suite passes after your commit - - Patch: - - - use "git format-patch -M" to create the patch - - do not PGP sign your patch - - be careful doing cut & paste, not to corrupt whitespaces. - - provide additional information (which is unsuitable for - the commit message) between the "---" and the diffstat - - if you change, add, or remove any features or - make some other user interface change, the associated - documentation should be updated as well. - - if your name is not writable in ASCII, make sure that - you send the patch in the correct encoding. - -Long version: - -I started reading over the SubmittingPatches document for git, -primarily because I wanted to have a document similar to it for -my projects to make sure people understand what they are doing -when they write "Signed-off-by" line. - -But the patch submission requirements are a lot more relaxed -here on the technical/contents front, because my projects are -thousand times smaller ;-). So here is only the relevant bits. - -(0) Decide what to base your work on. - -In general, always base your work on the oldest branch that your -change is relevant to. - - - A bugfix should be based on 'maint' in general. If the bug is not - present in 'maint', base it on 'master'. For a bug that's not yet - in 'master', find the topic that introduces the regression, and - base your work on the tip of the topic. - - - A new feature should be based on 'master' in general. If the new - feature depends on a topic that is in 'pu', but not in 'master', - base your work on the tip of that topic. - - - Corrections and enhancements to a topic not yet in 'master' should - be based on the tip of that topic. If the topic has not been merged - to 'next', it's alright to add a note to squash minor corrections - into the series. - - - In the exceptional case that a new feature depends on several topics - not in 'master', start working on 'next' or 'pu' privately and send - out patches for discussion. Before the final merge, you may have to - wait until some of the dependent topics graduate to 'master', and - rebase your work. - -To find the tip of a topic branch, run "git log --first-parent -master..pu" and look for the merge commit. The second parent of this -commit is the tip of the topic branch. - -(1) Make separate commits for logically separate changes. - -Unless your patch is really trivial, you should not be sending -out a patch that was generated between your working tree and -your commit head. Instead, always make a commit with complete -commit message and generate a series of patches from your -repository. It is a good discipline. - -Describe the technical detail of the change(s). - -If your description starts to get too long, that's a sign that you -probably need to split up your commit to finer grained pieces. -That being said, patches which plainly describe the things that -help reviewers check the patch, and future maintainers understand -the code, are the most beautiful patches. Descriptions that summarise -the point in the subject well, and describe the motivation for the -change, the approach taken by the change, and if relevant how this -differs substantially from the prior version, can be found on Usenet -archives back into the late 80's. Consider it like good Netiquette, -but for code. - -Oh, another thing. I am picky about whitespaces. Make sure your -changes do not trigger errors with the sample pre-commit hook shipped -in templates/hooks--pre-commit. To help ensure this does not happen, -run git diff --check on your changes before you commit. - -(2) Generate your patch using git tools out of your commits. - -git based diff tools (git, Cogito, and StGIT included) generate -unidiff which is the preferred format. - -You do not have to be afraid to use -M option to "git diff" or -"git format-patch", if your patch involves file renames. The -receiving end can handle them just fine. - -Please make sure your patch does not include any extra files -which do not belong in a patch submission. Make sure to review -your patch after generating it, to ensure accuracy. Before -sending out, please make sure it cleanly applies to the "master" -branch head. If you are preparing a work based on "next" branch, -that is fine, but please mark it as such. - - -(3) Sending your patches. - -People need to be able to read and comment on the changes you are -submitting. Do not cut-n-paste your patch; you can lose -tabs that way if you are not careful. - -It is a common convention to prefix your subject line with -[PATCH]. This lets people easily distinguish patches from other -e-mail discussions. Use of additional markers after PATCH and -the closing bracket to mark the nature of the patch is also -encouraged. E.g. [PATCH/RFC] is often used when the patch is -not ready to be applied but it is for discussion, [PATCH v2], -[PATCH v3] etc. are often seen when you are sending an update to -what you have previously sent. - -You often want to add additional explanation about the patch, -other than the commit message itself. Place such "cover letter" -material between the three dash lines and the diffstat. - -Do not PGP sign your patch, at least for now. Most likely, your -maintainer or other people on the list would not have your PGP -key and would not bother obtaining it anyway. Your patch is not -judged by who you are; a good patch from an unknown origin has a -far better chance of being accepted than a patch from a known, -respected origin that is done poorly or does incorrect things. - -If you really really really really want to do a PGP signed -patch, format it as "multipart/signed", not a text/plain message -that starts with '-----BEGIN PGP SIGNED MESSAGE-----'. That is -not a text/plain, it's something else. - -Unless your patch is a very trivial and an obviously correct one, -first send it with "To:" set to the mailing list, with "cc:" listing -people who are involved in the area you are touching (the output from -"git blame $path" and "git shortlog --no-merges $path" would help to -identify them), to solicit comments and reviews. After the list -reached a consensus that it is a good idea to apply the patch, re-send -it with "To:" set to the maintainer and optionally "cc:" the list for -inclusion. Do not forget to add trailers such as "Acked-by:", -"Reviewed-by:" and "Tested-by:" after your "Signed-off-by:" line as -necessary. - - -(4) Sign your work - -To improve tracking of who did what, we've borrowed the -"sign-off" procedure from the Linux kernel project on patches -that are being emailed around. Although this project is a lot -smaller it is a good discipline to follow it. - -The sign-off is a simple line at the end of the explanation for -the patch, which certifies that you wrote it or otherwise have -the right to pass it on as a open-source patch. The rules are -pretty simple: if you can certify the below: - - Developer's Certificate of Origin 1.1 - - By making a contribution to this project, I certify that: - - (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - - (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - - (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - - (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. - -then you just add a line saying - - Signed-off-by: Random J Developer - -This line can be automatically added by git if you run the git-commit -command with the -s option. - -Notice that you can place your own Signed-off-by: line when -forwarding somebody else's patch with the above rules for -D-C-O. Indeed you are encouraged to do so. - -Also notice that a real name is used in the Signed-off-by: line. Please -don't hide your real name. - -Some people also put extra tags at the end. - -"Acked-by:" says that the patch was reviewed by the person who -is more familiar with the issues and the area the patch attempts -to modify. "Tested-by:" says the patch was tested by the person -and found to have the desired effect. - ------------------------------------------------- -An ideal patch flow - -Here is an ideal patch flow for this project the current maintainer -suggests to the contributors: - - (0) You come up with an itch. You code it up. - - (1) Send it to the bug tracker and cc people who may need to know about - the change. - - The people who may need to know are the ones whose code you - are butchering. These people happen to be the ones who are - most likely to be knowledgeable enough to help you, but - they have no obligation to help you (i.e. you ask for help, - don't demand). "git log -p -- $area_you_are_modifying" would - help you find out who they are. - - (2) You get comments and suggestions for improvements. You may - even get them in a "on top of your change" patch form. - - (3) Polish, refine, and re-send to the the people who spend their - time to improve your patch. Go back to step (2). - - (4) A topic branch is created with the patch and is merged to 'next', - and cooked further and eventually graduates to 'master'. - -In any time between the (2)-(3) cycle, the maintainer may pick it up -from the list and queue it to 'pu', in order to make it easier for -people play with it without having to pick up and apply the patch to -their trees themselves. - ------------------------------------------------- -Know the status of your patch after submission - -* You can use Git itself to find out when your patch is merged in - master. 'git pull --rebase' will automatically skip already-applied - patches, and will let you know. This works only if you rebase on top - of the branch in which your patch has been merged (i.e. it will not - tell you if your patch is merged in pu if you rebase on top of - master). diff --git a/dist.ini b/dist.ini index af8e04f..c117598 100644 --- a/dist.ini +++ b/dist.ini @@ -18,6 +18,7 @@ remove = Readme [AutoPrereq] +[SubmittingPatches] [PkgVersion] [PodWeaver] [Prepender] From 4223114581ed090ffb2497d5ebc58ea5a7c31fe7 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Sat, 12 Jun 2010 14:03:02 -0400 Subject: [PATCH 128/140] move to non-legacy syntax Signed-off-by: Caleb Cushing --- dist.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist.ini b/dist.ini index c117598..3b5c798 100644 --- a/dist.ini +++ b/dist.ini @@ -13,8 +13,8 @@ repository.type = git [ReadmeFromPod] [@Filter] -bundle = @Basic -remove = Readme +-bundle = @Basic +-remove = Readme [AutoPrereq] From b5a3a2d5e58aca9e4be942eec1941e933930e8c4 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 14 Jun 2010 03:41:15 -0400 Subject: [PATCH 129/140] fix space at end of line Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index cef63cd..c0bca6a 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -61,7 +61,7 @@ output, which you can easily grep for. The nesting level is also shown. =head1 BUGS -Please report any bugs or feature requests on +Please report any bugs or feature requests on L as I'm not fond of RT. From 74fd52f1a2dbbd4d5c5a8f20b79036a35ac98e41 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 14 Jun 2010 03:40:07 -0400 Subject: [PATCH 130/140] Role-ify core T::SSS functionality Signed-off-by: Caleb Cushing --- .../Template/Context/Role/ShowStartStop.pm | 47 +++++++++++++++++++ lib/Template/ShowStartStop.pm | 23 +-------- 2 files changed, 48 insertions(+), 22 deletions(-) create mode 100644 lib/MooseX/Template/Context/Role/ShowStartStop.pm diff --git a/lib/MooseX/Template/Context/Role/ShowStartStop.pm b/lib/MooseX/Template/Context/Role/ShowStartStop.pm new file mode 100644 index 0000000..20c5817 --- /dev/null +++ b/lib/MooseX/Template/Context/Role/ShowStartStop.pm @@ -0,0 +1,47 @@ +package MooseX::Template::Context::Role::ShowStartStop; +use Moose::Role; + +override 'process' => sub { + my $self = shift; + my ( $template ) = @_; + + my $template_id + # conditional # set $template to + = ref($template) eq 'Template::Document' ? $template->name + : ref($template) eq 'ARRAY' ? join( ' + ', @{$template} ) + : ref($template) eq 'SCALAR' ? '(evaluated block)' + : $template + ; + + my $processed_data = super(); + + my $output + = "\n" + . "$processed_data" + . "\n" + ; + + return $output; +}; +1; +# ABSTRACT: Role to Display where templates start and stop + +=head1 SYNOPSIS + + use Moose; + extends 'Template::Context'; + with 'MooseX::Template::Context::Role::ShowStartStop'; + +=head1 BUGS + +Please report any bugs or feature requests on +L +as I'm not fond of RT. + +=head1 SUBMITTING PATCHES + +Please read the SubmittingPatches file included with this Distribution. Patches +that are of sufficient quality, within the goals of the project and pass the +checklist will probably be accepted. + +=cut diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index bc4307c..5d6cfc9 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -3,29 +3,8 @@ use Moose; use namespace::autoclean; extends 'Template::Context'; +with 'MooseX::Template::Context::Role::ShowStartStop'; -override 'process' => sub { - my $self = shift; - my ( $template ) = @_; - - my $template_id - # conditional # set $template to - = ref($template) eq 'Template::Document' ? $template->name - : ref($template) eq 'ARRAY' ? join( ' + ', @{$template} ) - : ref($template) eq 'SCALAR' ? '(evaluated block)' - : $template - ; - - my $processed_data = super(); - - my $output - = "\n" - . "$processed_data" - . "\n" - ; - - return $output; -}; __PACKAGE__->meta->make_immutable(inline_constructor => 0); 1; # ABSTRACT: Display where templates start and stop From 34623acd099a08543685946f5b9b5d41d44b5ce1 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 14 Jun 2010 03:59:15 -0400 Subject: [PATCH 131/140] add entry to Changes on T:SSS composing the Role Signed-off-by: Caleb Cushing --- Changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changes b/Changes index 7345e43..d6dff4a 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for Template::ShowStartStop {{$NEXT}} + - T:SSS now composes the ShowStopStart Role which really provides the + functionality 0.11 Jun 09 2010 - Moosify T:SSS From d3cb500c6981df29cfeef1a715775237f30cbfa8 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Mon, 14 Jun 2010 04:00:19 -0400 Subject: [PATCH 132/140] v0.12 - T:SSS now composes the ShowStopStart Role which really provides the functionality --- Changes | 2 ++ dist.ini | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index d6dff4a..891385f 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for Template::ShowStartStop {{$NEXT}} + +0.12 Jun 14 2010 - T:SSS now composes the ShowStopStart Role which really provides the functionality diff --git a/dist.ini b/dist.ini index 3b5c798..0f14f41 100644 --- a/dist.ini +++ b/dist.ini @@ -1,6 +1,6 @@ name = Template-ShowStartStop abstract = Display where templates start and stop -version = 0.11 +version = 0.12 author = Caleb Cushing license = Artistic_2_0 copyright_holder = Caleb Cushing From 5461b40542cd091b4796049940cb93631422d9f5 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 20 Jul 2010 04:05:32 -0400 Subject: [PATCH 133/140] I don't like the Role migrating back to not use it Signed-off-by: Caleb Cushing --- .../Template/Context/Role/ShowStartStop.pm | 47 ------------------- lib/Template/ShowStartStop.pm | 23 ++++++++- 2 files changed, 22 insertions(+), 48 deletions(-) delete mode 100644 lib/MooseX/Template/Context/Role/ShowStartStop.pm diff --git a/lib/MooseX/Template/Context/Role/ShowStartStop.pm b/lib/MooseX/Template/Context/Role/ShowStartStop.pm deleted file mode 100644 index 20c5817..0000000 --- a/lib/MooseX/Template/Context/Role/ShowStartStop.pm +++ /dev/null @@ -1,47 +0,0 @@ -package MooseX::Template::Context::Role::ShowStartStop; -use Moose::Role; - -override 'process' => sub { - my $self = shift; - my ( $template ) = @_; - - my $template_id - # conditional # set $template to - = ref($template) eq 'Template::Document' ? $template->name - : ref($template) eq 'ARRAY' ? join( ' + ', @{$template} ) - : ref($template) eq 'SCALAR' ? '(evaluated block)' - : $template - ; - - my $processed_data = super(); - - my $output - = "\n" - . "$processed_data" - . "\n" - ; - - return $output; -}; -1; -# ABSTRACT: Role to Display where templates start and stop - -=head1 SYNOPSIS - - use Moose; - extends 'Template::Context'; - with 'MooseX::Template::Context::Role::ShowStartStop'; - -=head1 BUGS - -Please report any bugs or feature requests on -L -as I'm not fond of RT. - -=head1 SUBMITTING PATCHES - -Please read the SubmittingPatches file included with this Distribution. Patches -that are of sufficient quality, within the goals of the project and pass the -checklist will probably be accepted. - -=cut diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index 5d6cfc9..bc4307c 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -3,8 +3,29 @@ use Moose; use namespace::autoclean; extends 'Template::Context'; -with 'MooseX::Template::Context::Role::ShowStartStop'; +override 'process' => sub { + my $self = shift; + my ( $template ) = @_; + + my $template_id + # conditional # set $template to + = ref($template) eq 'Template::Document' ? $template->name + : ref($template) eq 'ARRAY' ? join( ' + ', @{$template} ) + : ref($template) eq 'SCALAR' ? '(evaluated block)' + : $template + ; + + my $processed_data = super(); + + my $output + = "\n" + . "$processed_data" + . "\n" + ; + + return $output; +}; __PACKAGE__->meta->make_immutable(inline_constructor => 0); 1; # ABSTRACT: Display where templates start and stop From 8c49a353b238e4705b07c4d4b0b9f9064c252883 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 20 Jul 2010 04:06:44 -0400 Subject: [PATCH 134/140] remove Prepender Signed-off-by: Caleb Cushing --- dist.ini | 3 --- lib/Template/ShowStartStop.pm | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dist.ini b/dist.ini index 0f14f41..070f5f8 100644 --- a/dist.ini +++ b/dist.ini @@ -21,9 +21,6 @@ repository.type = git [SubmittingPatches] [PkgVersion] [PodWeaver] -[Prepender] -line = use strict; -line = use warnings; [NextRelease] format = %-9v %{MMM dd yyyy}d diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index bc4307c..02c469b 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -1,3 +1,5 @@ +use strict; +use warnings; package Template::ShowStartStop; use Moose; use namespace::autoclean; From b1b20d8ccf6b2b694590958cb247855bd950810d Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 20 Jul 2010 04:10:24 -0400 Subject: [PATCH 135/140] use SUPER not Moose I think Moose is probably too weighty for this little module Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index 02c469b..0bda501 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -1,12 +1,10 @@ use strict; use warnings; package Template::ShowStartStop; -use Moose; -use namespace::autoclean; +use SUPER; +use parent 'Template::Context'; -extends 'Template::Context'; - -override 'process' => sub { +sub process { my $self = shift; my ( $template ) = @_; @@ -18,7 +16,7 @@ override 'process' => sub { : $template ; - my $processed_data = super(); + my $processed_data = super; my $output = "\n" @@ -28,7 +26,6 @@ override 'process' => sub { return $output; }; -__PACKAGE__->meta->make_immutable(inline_constructor => 0); 1; # ABSTRACT: Display where templates start and stop =head1 SYNOPSIS From a2f80a16192688268bd71e8ef4e844020b94f975 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 20 Jul 2010 04:17:03 -0400 Subject: [PATCH 136/140] rename test to be ordered by number Signed-off-by: Caleb Cushing --- t/{basic.t => 01-basic.t} | 0 t/{include.t => 02-include.t} | 0 t/{process.t => 03-process.t} | 0 t/{insert.t => 04-insert.t} | 0 t/{wrapper.t => 05-wrapper.t} | 0 t/{eval.t => 06-eval.t} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename t/{basic.t => 01-basic.t} (100%) rename t/{include.t => 02-include.t} (100%) rename t/{process.t => 03-process.t} (100%) rename t/{insert.t => 04-insert.t} (100%) rename t/{wrapper.t => 05-wrapper.t} (100%) rename t/{eval.t => 06-eval.t} (100%) diff --git a/t/basic.t b/t/01-basic.t similarity index 100% rename from t/basic.t rename to t/01-basic.t diff --git a/t/include.t b/t/02-include.t similarity index 100% rename from t/include.t rename to t/02-include.t diff --git a/t/process.t b/t/03-process.t similarity index 100% rename from t/process.t rename to t/03-process.t diff --git a/t/insert.t b/t/04-insert.t similarity index 100% rename from t/insert.t rename to t/04-insert.t diff --git a/t/wrapper.t b/t/05-wrapper.t similarity index 100% rename from t/wrapper.t rename to t/05-wrapper.t diff --git a/t/eval.t b/t/06-eval.t similarity index 100% rename from t/eval.t rename to t/06-eval.t From dd361cae262a20f3ffe4d5ffcfd3e8cbf04dc107 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 20 Jul 2010 04:24:51 -0400 Subject: [PATCH 137/140] make template_id a method Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index 0bda501..67be1e7 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -4,17 +4,23 @@ package Template::ShowStartStop; use SUPER; use parent 'Template::Context'; -sub process { - my $self = shift; - my ( $template ) = @_; +sub _template_id { + my $template = shift; - my $template_id + return my $template_id # conditional # set $template to = ref($template) eq 'Template::Document' ? $template->name : ref($template) eq 'ARRAY' ? join( ' + ', @{$template} ) : ref($template) eq 'SCALAR' ? '(evaluated block)' : $template ; +} + +sub process { + my $self = shift; + my ( $template ) = @_; + + my $template_id = _template_id($template); my $processed_data = super; @@ -26,6 +32,7 @@ sub process { return $output; }; + 1; # ABSTRACT: Display where templates start and stop =head1 SYNOPSIS From a930e3166d1c6b62a4dc395e78c26162eefe8162 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 20 Jul 2010 04:33:33 -0400 Subject: [PATCH 138/140] turn on template debugging Signed-off-by: Caleb Cushing --- t/01-basic.t | 2 ++ 1 file changed, 2 insertions(+) diff --git a/t/01-basic.t b/t/01-basic.t index 70899d3..be44112 100644 --- a/t/01-basic.t +++ b/t/01-basic.t @@ -4,6 +4,8 @@ use warnings; use Template::ShowStartStop; use Template::Test; +$Template::Test::DEBUG = 1; + my $tt = Template->new({ CONTEXT => Template::ShowStartStop->new }); From 8bc7e1a375e071c444063f784e48d8a0d293f82c Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 20 Jul 2010 05:25:29 -0400 Subject: [PATCH 139/140] unimport super at end Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index 67be1e7..cf04022 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -32,7 +32,7 @@ sub process { return $output; }; - +no SUPER; 1; # ABSTRACT: Display where templates start and stop =head1 SYNOPSIS From 662402acfaf2fa850c52066488c910ac781ceb38 Mon Sep 17 00:00:00 2001 From: Caleb Cushing Date: Tue, 20 Jul 2010 06:18:25 -0400 Subject: [PATCH 140/140] return $output directly Signed-off-by: Caleb Cushing --- lib/Template/ShowStartStop.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Template/ShowStartStop.pm b/lib/Template/ShowStartStop.pm index cf04022..1f438a3 100644 --- a/lib/Template/ShowStartStop.pm +++ b/lib/Template/ShowStartStop.pm @@ -24,13 +24,12 @@ sub process { my $processed_data = super; - my $output + return my $output = "\n" . "$processed_data" . "\n" ; - return $output; }; no SUPER; 1;