r4348 - in /packages/libtemplate-plugin-class-perl: ./ branches/
branches/upstream/ branches/upstream/current/
branches/upstream/current/lib/ branches/upstream/current/lib/Template/
branches/upstream/current/lib/Template/Plugin/ branches/upstream/current/t/
tags/
eloy at users.alioth.debian.org
eloy at users.alioth.debian.org
Thu Nov 23 13:33:31 CET 2006
Author: eloy
Date: Thu Nov 23 13:33:31 2006
New Revision: 4348
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=4348
Log:
[svn-inject] Installing original source of libtemplate-plugin-class-perl
Added:
packages/libtemplate-plugin-class-perl/
packages/libtemplate-plugin-class-perl/branches/
packages/libtemplate-plugin-class-perl/branches/upstream/
packages/libtemplate-plugin-class-perl/branches/upstream/current/
packages/libtemplate-plugin-class-perl/branches/upstream/current/Build.PL
packages/libtemplate-plugin-class-perl/branches/upstream/current/Changes
packages/libtemplate-plugin-class-perl/branches/upstream/current/MANIFEST
packages/libtemplate-plugin-class-perl/branches/upstream/current/META.yml
packages/libtemplate-plugin-class-perl/branches/upstream/current/Makefile.PL
packages/libtemplate-plugin-class-perl/branches/upstream/current/README
packages/libtemplate-plugin-class-perl/branches/upstream/current/lib/
packages/libtemplate-plugin-class-perl/branches/upstream/current/lib/Template/
packages/libtemplate-plugin-class-perl/branches/upstream/current/lib/Template/Plugin/
packages/libtemplate-plugin-class-perl/branches/upstream/current/lib/Template/Plugin/Class.pm
packages/libtemplate-plugin-class-perl/branches/upstream/current/t/
packages/libtemplate-plugin-class-perl/branches/upstream/current/t/class.t
packages/libtemplate-plugin-class-perl/tags/
Added: packages/libtemplate-plugin-class-perl/branches/upstream/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtemplate-plugin-class-perl/branches/upstream/current/Build.PL?rev=4348&op=file
==============================================================================
--- packages/libtemplate-plugin-class-perl/branches/upstream/current/Build.PL (added)
+++ packages/libtemplate-plugin-class-perl/branches/upstream/current/Build.PL Thu Nov 23 13:33:31 2006
@@ -1,0 +1,14 @@
+use strict;
+use Module::Build;
+
+Module::Build->new(
+ module_name => "Template::Plugin::Class",
+ license => 'perl',
+ build_requires => {
+ 'Test::More' => 0,
+ },
+ requires => {
+ 'Template' => 0,
+ },
+ create_makefile_pl => 'traditional',
+ )->create_build_script;
Added: packages/libtemplate-plugin-class-perl/branches/upstream/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtemplate-plugin-class-perl/branches/upstream/current/Changes?rev=4348&op=file
==============================================================================
--- packages/libtemplate-plugin-class-perl/branches/upstream/current/Changes (added)
+++ packages/libtemplate-plugin-class-perl/branches/upstream/current/Changes Thu Nov 23 13:33:31 2006
@@ -1,0 +1,15 @@
+0.13 Wednesday 10th May, 2006
+ Make it work correctly when diagnostics.pm is in use.
+ http://rt.cpan.org/Ticket/Display.html?id=11538
+ Changed to ship a traditional Makefile.PL
+ Pulled the copy about rt.cpan.org from L</BUGS>
+
+0.12 Tuesday 13th January, 2004
+ Make the require logic softer by stealing from base.pm.
+ https://rt.cpan.org/Ticket/Display.html?id=4897
+
+0.11 Tuesday 26th August, 2003
+ test suite fixup
+
+0.10 Saturday 15th August, 2003
+ initial CPAN release
Added: packages/libtemplate-plugin-class-perl/branches/upstream/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtemplate-plugin-class-perl/branches/upstream/current/MANIFEST?rev=4348&op=file
==============================================================================
--- packages/libtemplate-plugin-class-perl/branches/upstream/current/MANIFEST (added)
+++ packages/libtemplate-plugin-class-perl/branches/upstream/current/MANIFEST Thu Nov 23 13:33:31 2006
@@ -1,0 +1,8 @@
+Changes
+Build.PL
+Makefile.PL
+META.yml
+README
+MANIFEST
+lib/Template/Plugin/Class.pm
+t/class.t
Added: packages/libtemplate-plugin-class-perl/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtemplate-plugin-class-perl/branches/upstream/current/META.yml?rev=4348&op=file
==============================================================================
--- packages/libtemplate-plugin-class-perl/branches/upstream/current/META.yml (added)
+++ packages/libtemplate-plugin-class-perl/branches/upstream/current/META.yml Thu Nov 23 13:33:31 2006
@@ -1,0 +1,19 @@
+---
+name: Template-Plugin-Class
+version: 0.13
+author:
+ - Richard Clamp <richardc at unixbeard.net>
+abstract: allow calling of class methods on arbitrary classes
+license: perl
+requires:
+ Template: 0
+build_requires:
+ Test::More: 0
+provides:
+ Template::Plugin::Class:
+ file: lib/Template/Plugin/Class.pm
+ version: 0.13
+ Template::Plugin::Class::Proxy:
+ file: lib/Template/Plugin/Class.pm
+ version: 0.13
+generated_by: Module::Build version 0.261
Added: packages/libtemplate-plugin-class-perl/branches/upstream/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtemplate-plugin-class-perl/branches/upstream/current/Makefile.PL?rev=4348&op=file
==============================================================================
--- packages/libtemplate-plugin-class-perl/branches/upstream/current/Makefile.PL (added)
+++ packages/libtemplate-plugin-class-perl/branches/upstream/current/Makefile.PL Thu Nov 23 13:33:31 2006
@@ -1,0 +1,14 @@
+# Note: this file was auto-generated by Module::Build::Compat version 0.03
+use ExtUtils::MakeMaker;
+WriteMakefile
+(
+ 'PL_FILES' => {},
+ 'INSTALLDIRS' => 'site',
+ 'NAME' => 'Template::Plugin::Class',
+ 'VERSION_FROM' => 'lib/Template/Plugin/Class.pm',
+ 'PREREQ_PM' => {
+ 'Test::More' => 0,
+ 'Template' => 0
+ }
+ )
+;
Added: packages/libtemplate-plugin-class-perl/branches/upstream/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtemplate-plugin-class-perl/branches/upstream/current/README?rev=4348&op=file
==============================================================================
--- packages/libtemplate-plugin-class-perl/branches/upstream/current/README (added)
+++ packages/libtemplate-plugin-class-perl/branches/upstream/current/README Thu Nov 23 13:33:31 2006
@@ -1,0 +1,68 @@
+README for Template::Plugin::Class 0.13
+
+=head1 NAME
+
+Template::Plugin::Class - allow calling of class methods on arbitrary classes
+
+=head1 SYNOPSIS
+
+ [% USE foo = Class('Foo') %]
+ [% foo.bar %]
+
+
+=head1 DEPENDENCIES
+
+This module has external dependencies on the following modules:
+
+ Template
+
+=head1 INSTALLATION
+
+ perl Build.PL
+ perl Build test
+
+and if all goes well
+
+ perl Build install
+
+=head1 HISTORY
+
+What changed over the last 3 revisions
+
+=over
+
+=item 0.13 Wednesday 10th May, 2006
+
+ Make it work correctly when diagnostics.pm is in use.
+ http://rt.cpan.org/Ticket/Display.html?id=11538
+ Changed to ship a traditional Makefile.PL
+ Pulled the copy about rt.cpan.org from L</BUGS>
+
+
+=item 0.12 Tuesday 13th January, 2004
+
+ Make the require logic softer by stealing from base.pm.
+ https://rt.cpan.org/Ticket/Display.html?id=4897
+
+
+=item 0.11 Tuesday 26th August, 2003
+
+ test suite fixup
+
+=back
+
+=head1 AUTHOR
+
+Richard Clamp <richardc at unixbeard.net>
+
+=head1 COPYRIGHT
+
+Copyright (C) 2003, 2004, 2006 Richard Clamp. All Rights Reserved.
+
+This module is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+=head1 SEE ALSO
+
+L<Template>
+
Added: packages/libtemplate-plugin-class-perl/branches/upstream/current/lib/Template/Plugin/Class.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtemplate-plugin-class-perl/branches/upstream/current/lib/Template/Plugin/Class.pm?rev=4348&op=file
==============================================================================
--- packages/libtemplate-plugin-class-perl/branches/upstream/current/lib/Template/Plugin/Class.pm (added)
+++ packages/libtemplate-plugin-class-perl/branches/upstream/current/lib/Template/Plugin/Class.pm Thu Nov 23 13:33:31 2006
@@ -1,0 +1,90 @@
+use strict;
+package Template::Plugin::Class;
+use base 'Template::Plugin';
+use vars qw( $VERSION );
+$VERSION = '0.13';
+
+sub new {
+ my $class = shift;
+ my $context = shift;
+ my $arg = shift;
+
+ # stolen from base.pm
+ eval "require $arg";
+ # Only ignore "Can't locate" errors from our eval require.
+ # Other fatal errors (syntax etc) must be reported.
+ (my $filename = $arg) =~ s!::!/!g;
+ die if $@ && $@ !~ /Can't locate \Q$filename\E\.pm/;
+ no strict 'refs';
+ unless (%{"$arg\::"}) {
+ require Carp;
+ Carp::croak("Package \"$arg\" is empty.\n",
+ "\t(Perhaps you need to 'use' the module ",
+ "which defines that package first.)");
+ }
+
+ return bless \$arg, 'Template::Plugin::Class::Proxy';
+}
+
+package Template::Plugin::Class::Proxy;
+use vars qw( $AUTOLOAD );
+
+sub AUTOLOAD {
+ my $self = shift;
+ my $class = ref $self;
+ my ($method) = ($AUTOLOAD =~ /^$class\::(.*)/);
+ $$self->$method(@_);
+}
+
+sub DESTROY {}
+
+1;
+__END__
+
+=head1 NAME
+
+Template::Plugin::Class - allow calling of class methods on arbitrary classes
+
+=head1 SYNOPSIS
+
+ [% USE foo = Class('Foo') %]
+ [% foo.bar %]
+
+=head1 DESCRIPTION
+
+Template::Plugin::Class allows you to call class methods on
+arbitrary classes. One use for this is in Class::DBI style
+applications, where you may do somthing like this:
+
+ [% USE cd = Class('Music::CD') %]
+ [% FOREACH disc = cd.retrieve_all %]
+ [% disc.artist %] - [% disc.title %]
+ [% END %]
+
+=head1 CAVEATS
+
+You won't be able to directly call C<AUTOLOAD> or C<DESTROY> methods
+on the remote class. This shouldn't be a huge hardship.
+
+=head1 BUGS
+
+Apart from the mentioned caveat, none currently known. If you find
+any please contact the author.
+
+=head1 AUTHOR
+
+Richard Clamp <richardc at unixbeard.net>
+
+=head1 COPYRIGHT
+
+Copyright (C) 2003, 2004, 2006 Richard Clamp. All Rights Reserved.
+
+This module is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+=head1 SEE ALSO
+
+L<Template>
+
+=cut
+
Added: packages/libtemplate-plugin-class-perl/branches/upstream/current/t/class.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtemplate-plugin-class-perl/branches/upstream/current/t/class.t?rev=4348&op=file
==============================================================================
--- packages/libtemplate-plugin-class-perl/branches/upstream/current/t/class.t (added)
+++ packages/libtemplate-plugin-class-perl/branches/upstream/current/t/class.t Thu Nov 23 13:33:31 2006
@@ -1,0 +1,18 @@
+#!perl -w
+use strict;
+use Test::More tests => 3;
+use Template;
+my $tt = Template->new;
+
+my $template = "[% USE foo=Class('Foo') %][% foo.bar %]";
+my $out;
+ok( $tt->process(\$template, {}, \$out), "processed ok" );
+is( $tt->error, undef, "no error" );
+
+is( $out, Foo->bar, "method was called" );
+
+BEGIN { $INC{'Foo.pm'} = 1 }
+package Foo;
+sub bar {
+ "I am returning bar";
+}
More information about the Pkg-perl-cvs-commits
mailing list