r54090 - in /branches/upstream/libcatalyst-view-tt-perl/current: ./ inc/Module/ inc/Module/Install/ lib/Catalyst/Helper/View/ lib/Catalyst/View/ t/lib/ t/lib/TestApp/Controller/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Thu Mar 11 14:54:21 UTC 2010


Author: jawnsy-guest
Date: Thu Mar 11 14:54:06 2010
New Revision: 54090

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=54090
Log:
[svn-upgrade] Integrating new upstream version, libcatalyst-view-tt-perl (0.33)

Modified:
    branches/upstream/libcatalyst-view-tt-perl/current/Changes
    branches/upstream/libcatalyst-view-tt-perl/current/META.yml
    branches/upstream/libcatalyst-view-tt-perl/current/README
    branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/AutoInstall.pm
    branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install.pm
    branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/AutoInstall.pm
    branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Base.pm
    branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Can.pm
    branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Fetch.pm
    branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Include.pm
    branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Makefile.pm
    branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Metadata.pm
    branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Win32.pm
    branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/WriteAll.pm
    branches/upstream/libcatalyst-view-tt-perl/current/lib/Catalyst/Helper/View/TT.pm
    branches/upstream/libcatalyst-view-tt-perl/current/lib/Catalyst/View/TT.pm
    branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp.pm
    branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp/Controller/Root.pm

Modified: branches/upstream/libcatalyst-view-tt-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/Changes?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/Changes (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/Changes Thu Mar 11 14:54:06 2010
@@ -1,4 +1,12 @@
 Revision history for Perl extension Catalyst::View::TT.
+
+0.33   2010-03-10 20:08:00
+        - The "render()" method now throws a warning on exception before
+          returning the exception. To silence the warning, pass 'render_die =>
+          0' to the constructor. Better yet, pass 'render_die => 1' to make it
+          die instead of returning the excption. This will be the default in a
+          future release when unspecified. The Helper will generate new views
+          with render_die => 1.
 
 0.32    2010-02-16 05:55:00
         - Various documentation improvements.

Modified: branches/upstream/libcatalyst-view-tt-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/META.yml?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/META.yml (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/META.yml Thu Mar 11 14:54:06 2010
@@ -8,7 +8,7 @@
 configure_requires:
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
-generated_by: 'Module::Install version 0.93'
+generated_by: 'Module::Install version 0.910'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -29,4 +29,4 @@
 resources:
   license: http://dev.perl.org/licenses/
   repository: http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-View-TT/
-version: 0.32
+version: 0.33

Modified: branches/upstream/libcatalyst-view-tt-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/README?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/README (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/README Thu Mar 11 14:54:06 2010
@@ -23,6 +23,7 @@
                 # Not set by default
                 PRE_PROCESS        => 'config/main',
                 WRAPPER            => 'site/wrapper',
+                render_die => 1, # Default for new apps, see render method docs
             },
         );
 
@@ -290,8 +291,8 @@
     N.B. This is usually done automatically by Catalyst::Action::RenderView.
 
   render($c, $template, \%args)
-    Renders the given template and returns output, or a Template::Exception
-    object upon error.
+    Renders the given template and returns output. Throws a
+    Template::Exception object upon error.
 
     The template variables are set to %$args if $args is a hashref, or
     $"$c->stash" otherwise. In either case the variables are augmented with
@@ -312,6 +313,21 @@
     Catalyst to render page fragments like this:
 
         my $fragment = $c->forward("View::TT", "render", $template_name, $c->stash->{fragment_data});
+
+   Backwards compatibility note
+    The render method used to just return the Template::Exception object,
+    rather than just throwing it. This is now deprecated and instead the
+    render method will throw an exception for new applications.
+
+    This behaviour can be activated (and is activated in the default
+    skeleton configuration) by using "render_die => 1". If you rely on the
+    legacy behaviour then a warning will be issued.
+
+    To silence this warning, set "render_die => 0", but it is recommended
+    you adjust your code so that it works with "render_die => 1".
+
+    In a future release, "render_die => 1" will become the default if
+    unspecified.
 
   template_vars
     Returns a list of keys/values to be used as the catalyst variables in

Modified: branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/AutoInstall.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/AutoInstall.pm?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/AutoInstall.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/AutoInstall.pm Thu Mar 11 14:54:06 2010
@@ -672,20 +672,7 @@
 sub _load_cpan {
     return if $CPAN::VERSION and $CPAN::Config and not @_;
     require CPAN;
-
-    # CPAN-1.82+ adds CPAN::Config::AUTOLOAD to redirect to
-    #    CPAN::HandleConfig->load. CPAN reports that the redirection
-    #    is deprecated in a warning printed at the user.
-
-    # CPAN-1.81 expects CPAN::HandleConfig->load, does not have
-    #   $CPAN::HandleConfig::VERSION but cannot handle
-    #   CPAN::Config->load
-
-    # Which "versions expect CPAN::Config->load?
-
-    if ( $CPAN::HandleConfig::VERSION
-        || CPAN::HandleConfig->can('load')
-    ) {
+    if ( $CPAN::HandleConfig::VERSION ) {
         # Newer versions of CPAN have a HandleConfig module
         CPAN::HandleConfig->load;
     } else {
@@ -815,4 +802,4 @@
 
 __END__
 
-#line 1069
+#line 1056

Modified: branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install.pm?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install.pm Thu Mar 11 14:54:06 2010
@@ -28,7 +28,7 @@
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '0.93';
+	$VERSION = '0.91';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -348,24 +348,17 @@
 	return $call;
 }
 
-# Done in evals to avoid confusing Perl::MinimumVersion
-eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
 sub _read {
 	local *FH;
-	open( FH, '<', $_[0] ) or die "open($_[0]): $!";
+	if ( $] >= 5.006 ) {
+		open( FH, '<', $_[0] ) or die "open($_[0]): $!";
+	} else {
+		open( FH, "< $_[0]"  ) or die "open($_[0]): $!";
+	}
 	my $string = do { local $/; <FH> };
 	close FH or die "close($_[0]): $!";
 	return $string;
 }
-END_NEW
-sub _read {
-	local *FH;
-	open( FH, "< $_[0]"  ) or die "open($_[0]): $!";
-	my $string = do { local $/; <FH> };
-	close FH or die "close($_[0]): $!";
-	return $string;
-}
-END_OLD
 
 sub _readperl {
 	my $string = Module::Install::_read($_[0]);
@@ -386,26 +379,18 @@
 	return $string;
 }
 
-# Done in evals to avoid confusing Perl::MinimumVersion
-eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
 sub _write {
 	local *FH;
-	open( FH, '>', $_[0] ) or die "open($_[0]): $!";
+	if ( $] >= 5.006 ) {
+		open( FH, '>', $_[0] ) or die "open($_[0]): $!";
+	} else {
+		open( FH, "> $_[0]"  ) or die "open($_[0]): $!";
+	}
 	foreach ( 1 .. $#_ ) {
 		print FH $_[$_] or die "print($_[0]): $!";
 	}
 	close FH or die "close($_[0]): $!";
 }
-END_NEW
-sub _write {
-	local *FH;
-	open( FH, "> $_[0]"  ) or die "open($_[0]): $!";
-	foreach ( 1 .. $#_ ) {
-		print FH $_[$_] or die "print($_[0]): $!";
-	}
-	close FH or die "close($_[0]): $!";
-}
-END_OLD
 
 # _version is for processing module versions (eg, 1.03_05) not
 # Perl versions (eg, 5.8.1).
@@ -442,4 +427,4 @@
 
 1;
 
-# Copyright 2008 - 2010 Adam Kennedy.
+# Copyright 2008 - 2009 Adam Kennedy.

Modified: branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/AutoInstall.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/AutoInstall.pm?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/AutoInstall.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/AutoInstall.pm Thu Mar 11 14:54:06 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.93';
+	$VERSION = '0.91';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Base.pm?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Base.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Base.pm Thu Mar 11 14:54:06 2010
@@ -4,13 +4,13 @@
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '0.93';
+	$VERSION = '0.91';
 }
 
 # Suspend handler for "redefined" warnings
 BEGIN {
-	my $w = $SIG{__WARN__};
-	$SIG{__WARN__} = sub { $w };
+#	my $w = $SIG{__WARN__};
+#	$SIG{__WARN__} = sub { $w };
 }
 
 #line 42
@@ -70,7 +70,7 @@
 
 # Restore warning handler
 BEGIN {
-	$SIG{__WARN__} = $SIG{__WARN__}->();
+#	$SIG{__WARN__} = $SIG{__WARN__}->();
 }
 
 1;

Modified: branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Can.pm?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Can.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Can.pm Thu Mar 11 14:54:06 2010
@@ -9,7 +9,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.93';
+	$VERSION = '0.91';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Fetch.pm?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Fetch.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Fetch.pm Thu Mar 11 14:54:06 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.93';
+	$VERSION = '0.91';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Include.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Include.pm?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Include.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Include.pm Thu Mar 11 14:54:06 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.93';
+	$VERSION = '0.91';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Makefile.pm?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Makefile.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Makefile.pm Thu Mar 11 14:54:06 2010
@@ -7,7 +7,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.93';
+	$VERSION = '0.91';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -34,17 +34,6 @@
 	}
 }
 
-# Store a cleaned up version of the MakeMaker version,
-# since we need to behave differently in a variety of
-# ways based on the MM version.
-my $makemaker = eval $ExtUtils::MakeMaker::VERSION;
-
-# If we are passed a param, do a "newer than" comparison.
-# Otherwise, just return the MakeMaker version.
-sub makemaker {
-	( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0
-}
-
 sub makemaker_args {
 	my $self = shift;
 	my $args = ( $self->{makemaker_args} ||= {} );
@@ -55,7 +44,7 @@
 # For mm args that take multiple space-seperated args,
 # append an argument to the current list.
 sub makemaker_append {
-	my $self = shift;
+	my $self = sShift;
 	my $name = shift;
 	my $args = $self->makemaker_args;
 	$args->{name} = defined $args->{$name}
@@ -118,9 +107,6 @@
 	%test_dir = ();
 	require File::Find;
 	File::Find::find( \&_wanted_t, $dir );
-	if ( -d 'xt' and ($ENV{RELEASE_TESTING} or $self->author) ) {
-		File::Find::find( \&_wanted_t, 'xt' );
-	}
 	$self->tests( join ' ', map { "$_/*.t" } sort keys %test_dir );
 }
 
@@ -144,13 +130,12 @@
 		# an underscore, even though its own version may contain one!
 		# Hence the funny regexp to get rid of it.  See RT #35800
 		# for details.
-		my $v = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/;
-		$self->build_requires(     'ExtUtils::MakeMaker' => $v );
-		$self->configure_requires( 'ExtUtils::MakeMaker' => $v );
+		$self->build_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
+		$self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
 	} else {
 		# Allow legacy-compatibility with 5.005 by depending on the
 		# most recent EU:MM that supported 5.005.
-		$self->build_requires(     'ExtUtils::MakeMaker' => 6.42 );
+		$self->build_requires( 'ExtUtils::MakeMaker' => 6.42 );
 		$self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
 	}
 
@@ -160,75 +145,49 @@
 	$args->{NAME}     = $self->module_name || $self->name;
 	$args->{VERSION}  = $self->version;
 	$args->{NAME}     =~ s/-/::/g;
-	$DB::single = 1;
 	if ( $self->tests ) {
 		$args->{test} = { TESTS => $self->tests };
-	} elsif ( -d 'xt' and ($self->author or $ENV{RELEASE_TESTING}) ) {
-		$args->{test} = {
-			TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ),
-		};
 	}
 	if ( $] >= 5.005 ) {
 		$args->{ABSTRACT} = $self->abstract;
 		$args->{AUTHOR}   = $self->author;
 	}
-	if ( $self->makemaker(6.10) ) {
-		$args->{NO_META}   = 1;
-		#$args->{NO_MYMETA} = 1;
-	}
-	if ( $self->makemaker(6.17) and $self->sign ) {
+	if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
+		$args->{NO_META} = 1;
+	}
+	if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
 		$args->{SIGN} = 1;
 	}
 	unless ( $self->is_admin ) {
 		delete $args->{SIGN};
 	}
 
+	# Merge both kinds of requires into prereq_pm
 	my $prereq = ($args->{PREREQ_PM} ||= {});
 	%$prereq = ( %$prereq,
-		map { @$_ } # flatten [module => version]
+		map { @$_ }
 		map { @$_ }
 		grep $_,
-		($self->requires)
+		($self->configure_requires, $self->build_requires, $self->requires)
 	);
 
 	# Remove any reference to perl, PREREQ_PM doesn't support it
 	delete $args->{PREREQ_PM}->{perl};
 
-	# Merge both kinds of requires into BUILD_REQUIRES
-	my $build_prereq = ($args->{BUILD_REQUIRES} ||= {});
-	%$build_prereq = ( %$build_prereq,
-		map { @$_ } # flatten [module => version]
-		map { @$_ }
-		grep $_,
-		($self->configure_requires, $self->build_requires)
-	);
-
-	# Remove any reference to perl, BUILD_REQUIRES doesn't support it
-	delete $args->{BUILD_REQUIRES}->{perl};
-
-	# Delete bundled dists from prereq_pm
+	# merge both kinds of requires into prereq_pm
 	my $subdirs = ($args->{DIR} ||= []);
 	if ($self->bundles) {
 		foreach my $bundle (@{ $self->bundles }) {
 			my ($file, $dir) = @$bundle;
 			push @$subdirs, $dir if -d $dir;
-			delete $build_prereq->{$file}; #Delete from build prereqs only
+			delete $prereq->{$file};
 		}
-	}
-
-	unless ( $self->makemaker('6.55_03') ) {
-		%$prereq = (%$prereq,%$build_prereq);
-		delete $args->{BUILD_REQUIRES};
 	}
 
 	if ( my $perl_version = $self->perl_version ) {
 		eval "use $perl_version; 1"
 			or die "ERROR: perl: Version $] is installed, "
 			. "but we need version >= $perl_version";
-
-		if ( $self->makemaker(6.48) ) {
-			$args->{MIN_PERL_VERSION} = $perl_version;
-		}
 	}
 
 	$args->{INSTALLDIRS} = $self->installdirs;
@@ -306,4 +265,4 @@
 
 __END__
 
-#line 435
+#line 394

Modified: branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Metadata.pm?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Metadata.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Metadata.pm Thu Mar 11 14:54:06 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.93';
+	$VERSION = '0.91';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -230,8 +230,6 @@
 		die("The path '$file' does not exist, or is not a file");
 	}
 
-	$self->{values}{all_from} = $file;
-
 	# Some methods pull from POD instead of code.
 	# If there is a matching .pod, use that instead
 	my $pod = $file;
@@ -387,10 +385,11 @@
 	}
 }
 
-sub _extract_perl_version {
+sub perl_version_from {
+	my $self = shift;
 	if (
-		$_[0] =~ m/
-		^\s*
+		Module::Install::_read($_[0]) =~ m/
+		^
 		(?:use|require) \s*
 		v?
 		([\d_\.]+)
@@ -399,16 +398,6 @@
 	) {
 		my $perl_version = $1;
 		$perl_version =~ s{_}{}g;
-		return $perl_version;
-	} else {
-		return;
-	}
-}
-
-sub perl_version_from {
-	my $self = shift;
-	my $perl_version=_extract_perl_version(Module::Install::_read($_[0]));
-	if ($perl_version) {
 		$self->perl_version($perl_version);
 	} else {
 		warn "Cannot determine perl version info from $_[0]\n";
@@ -436,12 +425,13 @@
 	}
 }
 
-sub _extract_license {
+sub license_from {
+	my $self = shift;
 	if (
-		$_[0] =~ m/
+		Module::Install::_read($_[0]) =~ m/
 		(
 			=head \d \s+
-			(?:licen[cs]e|licensing|copyrights?|legal)\b
+			(?:licen[cs]e|licensing|copyright|legal)\b
 			.*?
 		)
 		(=head\\d.*|=cut.*|)
@@ -449,9 +439,7 @@
 	/ixms ) {
 		my $license_text = $1;
 		my @phrases      = (
-			'under the same (?:terms|license) as (?:perl|the perl programming language)' => 'perl', 1,
-			'under the terms of (?:perl|the perl programming language) itself' => 'perl', 1,
-			'Artistic and GPL'                   => 'perl',        1,
+			'under the same (?:terms|license) as (?:perl|the perl programming language) itself' => 'perl', 1,
 			'GNU general public license'         => 'gpl',         1,
 			'GNU public license'                 => 'gpl',         1,
 			'GNU lesser general public license'  => 'lgpl',        1,
@@ -468,32 +456,20 @@
 			'proprietary'                        => 'proprietary', 0,
 		);
 		while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
-			$pattern =~ s#\s+#\\s+#gs;
+			$pattern =~ s{\s+}{\\s+}g;
 			if ( $license_text =~ /\b$pattern\b/i ) {
-			        return $license;
+				$self->license($license);
+				return 1;
 			}
 		}
-	} else {
-	        return;
-	}
-}
-
-sub license_from {
-	my $self = shift;
-	if (my $license=_extract_license(Module::Install::_read($_[0]))) {
-		$self->license($license);
-	} else {
-		warn "Cannot determine license info from $_[0]\n";
-		return 'unknown';
-	}
+	}
+
+	warn "Cannot determine license info from $_[0]\n";
+	return 'unknown';
 }
 
 sub _extract_bugtracker {
-	my @links   = $_[0] =~ m#L<(
-	 \Qhttp://rt.cpan.org/\E[^>]+|
-	 \Qhttp://github.com/\E[\w_]+/[\w_]+/issues|
-	 \Qhttp://code.google.com/p/\E[\w_\-]+/issues/list
-	 )>#gx;
+	my @links   = $_[0] =~ m#L<(\Qhttp://rt.cpan.org/\E[^>]+)>#g;
 	my %links;
 	@links{@links}=();
 	@links=keys %links;
@@ -509,7 +485,7 @@
 		return 0;
 	}
 	if ( @links > 1 ) {
-		warn "Found more than one bugtracker link in $_[0]\n";
+		warn "Found more than on rt.cpan.org link in $_[0]\n";
 		return 0;
 	}
 

Modified: branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Win32.pm?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Win32.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/Win32.pm Thu Mar 11 14:54:06 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.93';
+	$VERSION = '0.91';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/WriteAll.pm?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/WriteAll.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/inc/Module/Install/WriteAll.pm Thu Mar 11 14:54:06 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.93';;
+	$VERSION = '0.91';;
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libcatalyst-view-tt-perl/current/lib/Catalyst/Helper/View/TT.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/lib/Catalyst/Helper/View/TT.pm?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/lib/Catalyst/Helper/View/TT.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/lib/Catalyst/Helper/View/TT.pm Thu Mar 11 14:54:06 2010
@@ -55,7 +55,10 @@
 
 use base 'Catalyst::View::TT';
 
-__PACKAGE__->config(TEMPLATE_EXTENSION => '.tt');
+__PACKAGE__->config(
+    TEMPLATE_EXTENSION => '.tt',
+    render_die => 1,
+);
 
 =head1 NAME
 

Modified: branches/upstream/libcatalyst-view-tt-perl/current/lib/Catalyst/View/TT.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/lib/Catalyst/View/TT.pm?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/lib/Catalyst/View/TT.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/lib/Catalyst/View/TT.pm Thu Mar 11 14:54:06 2010
@@ -9,7 +9,7 @@
 use Template::Timer;
 use MRO::Compat;
 
-our $VERSION = '0.32';
+our $VERSION = '0.33';
 
 __PACKAGE__->mk_accessors('template');
 __PACKAGE__->mk_accessors('include_path');
@@ -43,6 +43,7 @@
             # Not set by default
             PRE_PROCESS        => 'config/main',
             WRAPPER            => 'site/wrapper',
+            render_die => 1, # Default for new apps, see render method docs
         },
     );
 
@@ -168,6 +169,7 @@
                                    @{ $p->{copy_config} };
                     }
                 }
+                local $@;
                 eval "require $prov";
                 if(!$@) {
                     push @providers, "$prov"->new($p->{args});
@@ -207,10 +209,10 @@
         return 0;
     }
 
-    my $output = $self->render($c, $template);
-
-    if (UNIVERSAL::isa($output, 'Template::Exception')) {
-        my $error = qq/Couldn't render template "$output"/;
+    local $@;
+    my $output = eval { $self->render($c, $template) };
+    if (my $err = $@) {
+        my $error = qq/Couldn't render template "$template"/;
         $c->log->error($error);
         $c->error($error);
         return 0;
@@ -240,11 +242,16 @@
         [ @{ $vars->{additional_template_paths} }, @{ $self->{include_path} } ]
         if ref $vars->{additional_template_paths};
 
-    unless ($self->template->process( $template, $vars, \$output ) ) {
+    unless ( $self->template->process( $template, $vars, \$output ) ) {
+        if (exists $self->{render_die}) {
+            die $self->template->error if $self->{render_die};
+            return $self->template->error;
+        }
+        require Carp;
+        Carp::carp('The Catalyst::View::TT render() method of will die on error in a future release. If you want it to continue to return the exception instead, pass render_die => 0 to the constructor');
         return $self->template->error;
-    } else {
-        return $output;
-    }
+    }
+    return $output;
 }
 
 sub template_vars {
@@ -525,7 +532,7 @@
 
 =head2 render($c, $template, \%args)
 
-Renders the given template and returns output, or a L<Template::Exception>
+Renders the given template and returns output. Throws a L<Template::Exception>
 object upon error.
 
 The template variables are set to C<%$args> if $args is a hashref, or
@@ -547,6 +554,22 @@
 to render page fragments like this:
 
     my $fragment = $c->forward("View::TT", "render", $template_name, $c->stash->{fragment_data});
+
+=head3 Backwards compatibility note
+
+The render method used to just return the Template::Exception object, rather
+than just throwing it. This is now deprecated and instead the render method
+will throw an exception for new applications.
+
+This behaviour can be activated (and is activated in the default skeleton
+configuration) by using C<< render_die => 1 >>. If you rely on the legacy
+behaviour then a warning will be issued.
+
+To silence this warning, set C<< render_die => 0 >>, but it is recommended
+you adjust your code so that it works with C<< render_die => 1 >>.
+
+In a future release, C<< render_die => 1 >> will become the default if
+unspecified.
 
 =head2 template_vars
 

Modified: branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp.pm?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp.pm Thu Mar 11 14:54:06 2010
@@ -16,6 +16,7 @@
         PRE_CHOMP          => 1,
         POST_CHOMP         => 1,
         TEMPLATE_EXTENSION => '.tt',
+        render_die         => 1,
     },
 );
 

Modified: branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp/Controller/Root.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp/Controller/Root.pm?rev=54090&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp/Controller/Root.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp/Controller/Root.pm Thu Mar 11 14:54:06 2010
@@ -34,9 +34,9 @@
 sub test_render : Local {
     my ($self, $c) = @_;
 
-    my $out = $c->stash->{message} = $c->view('TT::Appconfig')->render($c, $c->req->param('template'), {param => $c->req->param('param') || ''});
-    if (UNIVERSAL::isa($out, 'Template::Exception')) {
-        $c->response->body($out);
+    $c->stash->{message} = eval { $c->view('TT::Appconfig')->render($c, $c->req->param('template'), {param => $c->req->param('param') || ''}) };
+    if (my $err = $@) {
+        $c->response->body($err);
         $c->response->status(403);
     } else {
         $c->stash->{template} = 'test.tt';




More information about the Pkg-perl-cvs-commits mailing list