From b272e44f7cd58fe29f77754a190da5f11b37bbeb Mon Sep 17 00:00:00 2001 From: Justin DeVuyst Date: Wed, 15 Feb 2017 15:33:14 -0500 Subject: [PATCH 1/2] Get dzil test working again. --- .stopwords | 7 +++++++ dist.ini | 3 +-- lib/HTML/Mason.pm | 2 +- lib/HTML/Mason/Apache/Request.pm | 2 +- lib/HTML/Mason/CGIHandler.pm | 2 +- lib/HTML/Mason/Cache/BaseCache.pm | 2 +- lib/HTML/Mason/Compiler.pm | 2 +- lib/HTML/Mason/Compiler/ToObject.pm | 2 +- lib/HTML/Mason/Component.pm | 2 +- lib/HTML/Mason/Component/FileBased.pm | 2 +- lib/HTML/Mason/Component/Subcomponent.pm | 2 +- lib/HTML/Mason/ComponentSource.pm | 2 +- lib/HTML/Mason/Escapes.pm | 2 +- lib/HTML/Mason/Exceptions.pm | 2 +- lib/HTML/Mason/FakeApache.pm | 2 +- lib/HTML/Mason/Handler.pm | 2 +- lib/HTML/Mason/Interp.pm | 2 +- lib/HTML/Mason/Lexer.pm | 2 +- lib/HTML/Mason/MethodMaker.pm | 2 +- lib/HTML/Mason/Params.pod | 2 +- lib/HTML/Mason/Plugin.pm | 2 +- lib/HTML/Mason/Plugin/Context.pm | 2 +- lib/HTML/Mason/Request.pm | 4 ++-- lib/HTML/Mason/Resolver.pm | 2 +- lib/HTML/Mason/Resolver/File.pm | 2 +- lib/HTML/Mason/Resolver/Null.pm | 2 +- lib/HTML/Mason/Tests.pm | 2 +- lib/HTML/Mason/Tools.pm | 2 +- lib/HTML/Mason/Utils.pm | 2 +- 29 files changed, 36 insertions(+), 30 deletions(-) diff --git a/.stopwords b/.stopwords index f78d174b..c98c83e3 100644 --- a/.stopwords +++ b/.stopwords @@ -1,6 +1,10 @@ +404s +0x +1x AUTOHANDLERS Adminstrator ApacheModPerl +ApacheModPerl2 ApacheReload Autohandlers Bekman @@ -26,6 +30,7 @@ Kumar LFU LogLevel MSIE +MD5 MailingLists Mallah MasonAllowGlobals @@ -97,8 +102,10 @@ Subcomponents Subrequests TIEHASH USR +USR1 UserDir Vivek +Win32 ala apachectl apachehandler diff --git a/dist.ini b/dist.ini index 65562050..3bf485a1 100644 --- a/dist.ini +++ b/dist.ini @@ -6,8 +6,6 @@ license = Perl_5 copyright_year = 1998 copyright_holder = Jonathan Swartz -version = 1.56 - [FileFinder::Filter / SkipApacheHandler] finder = :InstallModules skip = lib/HTML/Mason/ApacheHandler.pm @@ -27,6 +25,7 @@ stopwords_file = .stopwords -remove = Test::Pod::No404s -remove = Test::Portability -remove = Test::Synopsis +-remove = Test::CleanNamespaces [MetaNoIndex] directory = eg diff --git a/lib/HTML/Mason.pm b/lib/HTML/Mason.pm index cae410e3..404d48e1 100644 --- a/lib/HTML/Mason.pm +++ b/lib/HTML/Mason.pm @@ -2,7 +2,7 @@ package HTML::Mason; # Copyright (c) 1998-2005 by Jonathan Swartz. All rights reserved. # This program is free software; you can redistribute it and/or modify it # under the same terms as Perl itself. - +$HTML::Mason::VERSION = '1.56'; use 5.006; use HTML::Mason::Interp; diff --git a/lib/HTML/Mason/Apache/Request.pm b/lib/HTML/Mason/Apache/Request.pm index 128b249e..297687f0 100644 --- a/lib/HTML/Mason/Apache/Request.pm +++ b/lib/HTML/Mason/Apache/Request.pm @@ -5,7 +5,7 @@ # under the same terms as Perl itself. package HTML::Mason::Apache::Request; - +$HTML::Mason::Apache::Request::VERSION = '1.56'; use strict; use warnings; diff --git a/lib/HTML/Mason/CGIHandler.pm b/lib/HTML/Mason/CGIHandler.pm index 6faba03a..2060ad57 100644 --- a/lib/HTML/Mason/CGIHandler.pm +++ b/lib/HTML/Mason/CGIHandler.pm @@ -1,5 +1,5 @@ package HTML::Mason::CGIHandler; - +$HTML::Mason::CGIHandler::VERSION = '1.56'; use strict; use warnings; diff --git a/lib/HTML/Mason/Cache/BaseCache.pm b/lib/HTML/Mason/Cache/BaseCache.pm index d9eb5802..de36ac96 100644 --- a/lib/HTML/Mason/Cache/BaseCache.pm +++ b/lib/HTML/Mason/Cache/BaseCache.pm @@ -3,7 +3,7 @@ # under the same terms as Perl itself. package HTML::Mason::Cache::BaseCache; - +$HTML::Mason::Cache::BaseCache::VERSION = '1.56'; use strict; use warnings; diff --git a/lib/HTML/Mason/Compiler.pm b/lib/HTML/Mason/Compiler.pm index d43a244f..dce73687 100644 --- a/lib/HTML/Mason/Compiler.pm +++ b/lib/HTML/Mason/Compiler.pm @@ -3,7 +3,7 @@ # under the same terms as Perl itself. package HTML::Mason::Compiler; - +$HTML::Mason::Compiler::VERSION = '1.56'; use strict; use warnings; use Data::Dumper; diff --git a/lib/HTML/Mason/Compiler/ToObject.pm b/lib/HTML/Mason/Compiler/ToObject.pm index bc79d4f4..6846c728 100644 --- a/lib/HTML/Mason/Compiler/ToObject.pm +++ b/lib/HTML/Mason/Compiler/ToObject.pm @@ -3,7 +3,7 @@ # it under the same terms as Perl itself. package HTML::Mason::Compiler::ToObject; - +$HTML::Mason::Compiler::ToObject::VERSION = '1.56'; use strict; use warnings; diff --git a/lib/HTML/Mason/Component.pm b/lib/HTML/Mason/Component.pm index bd674eec..a962e6ca 100644 --- a/lib/HTML/Mason/Component.pm +++ b/lib/HTML/Mason/Component.pm @@ -3,7 +3,7 @@ # under the same terms as Perl itself. package HTML::Mason::Component; - +$HTML::Mason::Component::VERSION = '1.56'; use strict; use warnings; use File::Spec; diff --git a/lib/HTML/Mason/Component/FileBased.pm b/lib/HTML/Mason/Component/FileBased.pm index d38fab79..425a211f 100644 --- a/lib/HTML/Mason/Component/FileBased.pm +++ b/lib/HTML/Mason/Component/FileBased.pm @@ -3,7 +3,7 @@ # it under the same terms as Perl itself. package HTML::Mason::Component::FileBased; - +$HTML::Mason::Component::FileBased::VERSION = '1.56'; use strict; use warnings; diff --git a/lib/HTML/Mason/Component/Subcomponent.pm b/lib/HTML/Mason/Component/Subcomponent.pm index 5061e375..325c4809 100644 --- a/lib/HTML/Mason/Component/Subcomponent.pm +++ b/lib/HTML/Mason/Component/Subcomponent.pm @@ -3,7 +3,7 @@ # it under the same terms as Perl itself. package HTML::Mason::Component::Subcomponent; - +$HTML::Mason::Component::Subcomponent::VERSION = '1.56'; use strict; use warnings; diff --git a/lib/HTML/Mason/ComponentSource.pm b/lib/HTML/Mason/ComponentSource.pm index 7705ccb2..b3eb148c 100644 --- a/lib/HTML/Mason/ComponentSource.pm +++ b/lib/HTML/Mason/ComponentSource.pm @@ -3,7 +3,7 @@ # under the same terms as Perl itself. package HTML::Mason::ComponentSource; - +$HTML::Mason::ComponentSource::VERSION = '1.56'; use strict; use warnings; use File::Basename; diff --git a/lib/HTML/Mason/Escapes.pm b/lib/HTML/Mason/Escapes.pm index 2eeff023..6a52ae56 100644 --- a/lib/HTML/Mason/Escapes.pm +++ b/lib/HTML/Mason/Escapes.pm @@ -7,7 +7,7 @@ # package HTML::Mason::Escapes; - +$HTML::Mason::Escapes::VERSION = '1.56'; use strict; use warnings; diff --git a/lib/HTML/Mason/Exceptions.pm b/lib/HTML/Mason/Exceptions.pm index 6ec87e31..9d26b18d 100644 --- a/lib/HTML/Mason/Exceptions.pm +++ b/lib/HTML/Mason/Exceptions.pm @@ -1,5 +1,5 @@ package HTML::Mason::Exceptions; - +$HTML::Mason::Exceptions::VERSION = '1.56'; use strict; use warnings; diff --git a/lib/HTML/Mason/FakeApache.pm b/lib/HTML/Mason/FakeApache.pm index 93015d61..b454bafb 100644 --- a/lib/HTML/Mason/FakeApache.pm +++ b/lib/HTML/Mason/FakeApache.pm @@ -1,5 +1,5 @@ package HTML::Mason::FakeApache; - +$HTML::Mason::FakeApache::VERSION = '1.56'; use strict; use warnings; diff --git a/lib/HTML/Mason/Handler.pm b/lib/HTML/Mason/Handler.pm index 6c78bafa..5c065639 100644 --- a/lib/HTML/Mason/Handler.pm +++ b/lib/HTML/Mason/Handler.pm @@ -9,7 +9,7 @@ # package HTML::Mason::Handler; - +$HTML::Mason::Handler::VERSION = '1.56'; use strict; use warnings; diff --git a/lib/HTML/Mason/Interp.pm b/lib/HTML/Mason/Interp.pm index 1250a0dd..26ee1804 100644 --- a/lib/HTML/Mason/Interp.pm +++ b/lib/HTML/Mason/Interp.pm @@ -5,7 +5,7 @@ # under the same terms as Perl itself. package HTML::Mason::Interp; - +$HTML::Mason::Interp::VERSION = '1.56'; use strict; use warnings; diff --git a/lib/HTML/Mason/Lexer.pm b/lib/HTML/Mason/Lexer.pm index 0d88b711..6e25a7f2 100644 --- a/lib/HTML/Mason/Lexer.pm +++ b/lib/HTML/Mason/Lexer.pm @@ -3,7 +3,7 @@ # under the same terms as Perl itself. package HTML::Mason::Lexer; - +$HTML::Mason::Lexer::VERSION = '1.56'; use strict; use warnings; diff --git a/lib/HTML/Mason/MethodMaker.pm b/lib/HTML/Mason/MethodMaker.pm index 398d109e..e31a0820 100644 --- a/lib/HTML/Mason/MethodMaker.pm +++ b/lib/HTML/Mason/MethodMaker.pm @@ -3,7 +3,7 @@ # under the same terms as Perl itself. package HTML::Mason::MethodMaker; - +$HTML::Mason::MethodMaker::VERSION = '1.56'; use strict; use warnings; diff --git a/lib/HTML/Mason/Params.pod b/lib/HTML/Mason/Params.pod index 0113be1c..737fae86 100644 --- a/lib/HTML/Mason/Params.pod +++ b/lib/HTML/Mason/Params.pod @@ -977,7 +977,7 @@ The class to use when creating a lexer. Defaults to L Date: Wed, 15 Feb 2017 15:49:02 -0500 Subject: [PATCH 2/2] Fix line number reporting for multi-line <% %> blocks. See RT #120249. --- lib/HTML/Mason/Lexer.pm | 2 -- t/06-compiler.t | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/HTML/Mason/Lexer.pm b/lib/HTML/Mason/Lexer.pm index 6e25a7f2..f039c3d6 100644 --- a/lib/HTML/Mason/Lexer.pm +++ b/lib/HTML/Mason/Lexer.pm @@ -391,8 +391,6 @@ sub match_substitute %> # Closing tag }xcigs ) { - $self->{current}{lines} += tr/\n// foreach grep defined, ($1, $2); - $self->{current}{compiler}->substitution( substitution => $1, escape => $3 ); return 1; diff --git a/t/06-compiler.t b/t/06-compiler.t index e4bde01e..8bb2e73a 100644 --- a/t/06-compiler.t +++ b/t/06-compiler.t @@ -486,6 +486,20 @@ EOF expect_error => qr/really #4 .* line 4/, ); +#------------------------------------------------------------ + + $group->add_test( name => 'line_nums_multi-line_substitution_block', + description => 'be sure line numbers aren\'t inflated by block size', + component => <<'EOF', +<% do { + +die "I'm at #3"; + +} %> +EOF + expect_error => qr/at #3 .* line 3/, + ); + #------------------------------------------------------------ $group->add_test( name => 'attr_block_zero',