r50095 - in /branches/upstream/libtemplate-plugin-clickable-email-perl: ./ current/ current/lib/ current/lib/Template/ current/lib/Template/Plugin/ current/lib/Template/Plugin/Clickable/ current/t/

emhn-guest at users.alioth.debian.org emhn-guest at users.alioth.debian.org
Sun Jan 3 22:54:21 UTC 2010


Author: emhn-guest
Date: Sun Jan  3 22:54:15 2010
New Revision: 50095

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=50095
Log:
[svn-inject] Installing original source of libtemplate-plugin-clickable-email-perl

Added:
    branches/upstream/libtemplate-plugin-clickable-email-perl/
    branches/upstream/libtemplate-plugin-clickable-email-perl/current/
    branches/upstream/libtemplate-plugin-clickable-email-perl/current/Build.PL
    branches/upstream/libtemplate-plugin-clickable-email-perl/current/Changes
    branches/upstream/libtemplate-plugin-clickable-email-perl/current/MANIFEST
    branches/upstream/libtemplate-plugin-clickable-email-perl/current/META.yml
    branches/upstream/libtemplate-plugin-clickable-email-perl/current/README
    branches/upstream/libtemplate-plugin-clickable-email-perl/current/lib/
    branches/upstream/libtemplate-plugin-clickable-email-perl/current/lib/Template/
    branches/upstream/libtemplate-plugin-clickable-email-perl/current/lib/Template/Plugin/
    branches/upstream/libtemplate-plugin-clickable-email-perl/current/lib/Template/Plugin/Clickable/
    branches/upstream/libtemplate-plugin-clickable-email-perl/current/lib/Template/Plugin/Clickable/Email.pm
    branches/upstream/libtemplate-plugin-clickable-email-perl/current/t/
    branches/upstream/libtemplate-plugin-clickable-email-perl/current/t/00-load.t
    branches/upstream/libtemplate-plugin-clickable-email-perl/current/t/01-filter.t
    branches/upstream/libtemplate-plugin-clickable-email-perl/current/t/pod.t

Added: branches/upstream/libtemplate-plugin-clickable-email-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtemplate-plugin-clickable-email-perl/current/Build.PL?rev=50095&op=file
==============================================================================
--- branches/upstream/libtemplate-plugin-clickable-email-perl/current/Build.PL (added)
+++ branches/upstream/libtemplate-plugin-clickable-email-perl/current/Build.PL Sun Jan  3 22:54:15 2010
@@ -1,0 +1,18 @@
+use strict;
+use warnings;
+use Module::Build;
+
+my $builder = Module::Build->new(
+    module_name         => 'Template::Plugin::Clickable::Email',
+    license             => 'bsd',
+    dist_author         => 'Nik Clayton <nik at FreeBSD.org>',
+    dist_version_from   => 'lib/Template/Plugin/Clickable/Email.pm',
+    requires => {
+		 'Test::More' => 0,
+		 'Email::Find' => 0,
+		 'Template' => 0,
+    },
+    add_to_cleanup      => [ 'Template-Plugin-Clickable-Email-*' ],
+);
+
+$builder->create_build_script();

Added: branches/upstream/libtemplate-plugin-clickable-email-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtemplate-plugin-clickable-email-perl/current/Changes?rev=50095&op=file
==============================================================================
--- branches/upstream/libtemplate-plugin-clickable-email-perl/current/Changes (added)
+++ branches/upstream/libtemplate-plugin-clickable-email-perl/current/Changes Sun Jan  3 22:54:15 2010
@@ -1,0 +1,5 @@
+Revision history for Template-Plugin-Clickable-Email
+
+0.01    Date/time
+        First version, released on an unsuspecting world.
+

Added: branches/upstream/libtemplate-plugin-clickable-email-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtemplate-plugin-clickable-email-perl/current/MANIFEST?rev=50095&op=file
==============================================================================
--- branches/upstream/libtemplate-plugin-clickable-email-perl/current/MANIFEST (added)
+++ branches/upstream/libtemplate-plugin-clickable-email-perl/current/MANIFEST Sun Jan  3 22:54:15 2010
@@ -1,0 +1,9 @@
+Build.PL
+Changes
+MANIFEST
+META.yml # Will be created by "make dist"
+README
+lib/Template/Plugin/Clickable/Email.pm
+t/00-load.t
+t/01-filter.t
+t/pod.t

Added: branches/upstream/libtemplate-plugin-clickable-email-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtemplate-plugin-clickable-email-perl/current/META.yml?rev=50095&op=file
==============================================================================
--- branches/upstream/libtemplate-plugin-clickable-email-perl/current/META.yml (added)
+++ branches/upstream/libtemplate-plugin-clickable-email-perl/current/META.yml Sun Jan  3 22:54:15 2010
@@ -1,0 +1,16 @@
+---
+name: Template-Plugin-Clickable-Email
+version: 0.01
+author:
+  - Nik Clayton <nik at FreeBSD.org>
+abstract: Make email addresses in to HTML links
+license: bsd
+requires:
+  Email::Find: 0
+  Template: 0
+  Test::More: 0
+provides:
+  Template::Plugin::Clickable::Email:
+    file: lib/Template/Plugin/Clickable/Email.pm
+    version: 0.01
+generated_by: Module::Build version 0.2611

Added: branches/upstream/libtemplate-plugin-clickable-email-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtemplate-plugin-clickable-email-perl/current/README?rev=50095&op=file
==============================================================================
--- branches/upstream/libtemplate-plugin-clickable-email-perl/current/README (added)
+++ branches/upstream/libtemplate-plugin-clickable-email-perl/current/README Sun Jan  3 22:54:15 2010
@@ -1,0 +1,64 @@
+NAME
+    Template::Plugin::Clickable::Email - Make email addresses in to HTML
+    links
+
+VERSION
+    Version 0.01
+
+SYNOPSIS
+      [% USE link_emails = Clickable::Email %]
+
+    Then
+
+      [% text | $link_emails %]
+
+    or
+
+      [% FILTER $link_emails %]
+      <p>Some text that contains an address: nik at FreeBSD.org.</p>
+      [% END %]
+
+DESCRIPTION
+    Template::Plugin::Clickable::Email converts any e-mail addresses found
+    in the filtered text in to HTML "mailto:" links.
+
+    This module uses Email::Find, see the documentation for that module for
+    caveats relating to how addresses are parsed, and why some false
+    positives may occur.
+
+AUTHOR
+    Nik Clayton, "<nik at FreeBSD.org>"
+
+BUGS
+    Please report any bugs or feature requests to
+    "bug-template-plugin-clickable-email at rt.cpan.org", or through the web
+    interface at
+    <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Template-Plugin-Clickabl
+    e-Email>. I will be notified, and then you'll automatically be notified
+    of progress on your bug as I make changes.
+
+COPYRIGHT & LICENSE
+    Copyright (c) 2005 Nik Clayton All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are
+    met:
+
+     1. Redistributions of source code must retain the above copyright
+        notice, this list of conditions and the following disclaimer.
+     2. Redistributions in binary form must reproduce the above copyright
+        notice, this list of conditions and the following disclaimer in the
+        documentation and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
+    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+    THE POSSIBILITY OF SUCH DAMAGE.
+

Added: branches/upstream/libtemplate-plugin-clickable-email-perl/current/lib/Template/Plugin/Clickable/Email.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtemplate-plugin-clickable-email-perl/current/lib/Template/Plugin/Clickable/Email.pm?rev=50095&op=file
==============================================================================
--- branches/upstream/libtemplate-plugin-clickable-email-perl/current/lib/Template/Plugin/Clickable/Email.pm (added)
+++ branches/upstream/libtemplate-plugin-clickable-email-perl/current/lib/Template/Plugin/Clickable/Email.pm Sun Jan  3 22:54:15 2010
@@ -1,0 +1,125 @@
+package Template::Plugin::Clickable::Email;
+
+# Copyright (c) 2005 Nik Clayton
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+use warnings;
+use strict;
+
+use Template::Plugin::Filter;
+use base qw(Template::Plugin::Filter);
+
+use Email::Find;
+
+=head1 NAME
+
+Template::Plugin::Clickable::Email - Make email addresses in to HTML links
+
+=head1 VERSION
+
+Version 0.01
+
+=cut
+
+our $VERSION = '0.01';
+
+sub filter {
+    my($self, $text) = @_;
+    my $finder =
+      Email::Find->new(
+		       sub {
+			 my($email, $orig_email) = @_;
+			 my($address) = $email->format;
+			 return qq|<a href="mailto:$address">$orig_email</a>|;
+		       },
+		      );
+    $finder->find(\$text);
+    return $text;
+}
+
+=head1 SYNOPSIS
+
+  [% USE link_emails = Clickable::Email %]
+
+Then
+
+  [% text | $link_emails %]
+
+or
+
+  [% FILTER $link_emails %]
+  <p>Some text that contains an address: nik at FreeBSD.org.</p>
+  [% END %]
+
+=head1 DESCRIPTION
+
+Template::Plugin::Clickable::Email converts any e-mail addresses found in
+the filtered text in to HTML C<mailto:> links.
+
+This module uses Email::Find, see the documentation for that module for
+caveats relating to how addresses are parsed, and why some false positives
+may occur.
+
+=head1 AUTHOR
+
+Nik Clayton, C<< <nik at FreeBSD.org> >>
+
+=head1 BUGS
+
+Please report any bugs or feature requests to
+C<bug-template-plugin-clickable-email at rt.cpan.org>, or through the web interface at
+L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Template-Plugin-Clickable-Email>.
+I will be notified, and then you'll automatically be notified of progress on
+your bug as I make changes.
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright (c) 2005 Nik Clayton
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+=cut
+
+1; # End of Template::Plugin::Clickable::Email

Added: branches/upstream/libtemplate-plugin-clickable-email-perl/current/t/00-load.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtemplate-plugin-clickable-email-perl/current/t/00-load.t?rev=50095&op=file
==============================================================================
--- branches/upstream/libtemplate-plugin-clickable-email-perl/current/t/00-load.t (added)
+++ branches/upstream/libtemplate-plugin-clickable-email-perl/current/t/00-load.t Sun Jan  3 22:54:15 2010
@@ -1,0 +1,9 @@
+#!perl -T
+
+use Test::More tests => 1;
+
+BEGIN {
+	use_ok( 'Template::Plugin::Clickable::Email' );
+}
+
+diag( "Testing Template::Plugin::Clickable::Email $Template::Plugin::Clickable::Email::VERSION, Perl $], $^X" );

Added: branches/upstream/libtemplate-plugin-clickable-email-perl/current/t/01-filter.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtemplate-plugin-clickable-email-perl/current/t/01-filter.t?rev=50095&op=file
==============================================================================
--- branches/upstream/libtemplate-plugin-clickable-email-perl/current/t/01-filter.t (added)
+++ branches/upstream/libtemplate-plugin-clickable-email-perl/current/t/01-filter.t Sun Jan  3 22:54:15 2010
@@ -1,0 +1,57 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+use Template;
+use Test::More;
+
+plan tests => 3;
+
+my $tt = Template->new();
+
+# Make sure that normal TT processing works ...
+
+my $template;
+
+$template = <<'EOTEMPLATE';
+hello, world
+EOTEMPLATE
+
+my $output;
+
+$tt->process(\$template, undef, \$output);
+
+is($template, $output, 'Basic template processing');
+
+# Now use a [% FILTER ... %] block to run the filter ...
+
+$template = <<'EOTEMPLATE';
+[%- USE e = Clickable::Email -%]
+[%- FILTER $e -%]
+text nik at FreeBSD.org text
+[% END -%]
+EOTEMPLATE
+
+my $expected_output = <<'EOT';
+text <a href="mailto:nik at FreeBSD.org">nik at FreeBSD.org</a> text
+EOT
+
+$output = '';
+
+$tt->process(\$template, undef, \$output);
+
+is($output, $expected_output, 'Works in [% FILTER ... %] block');
+
+# Now try and use the filter 'inline' ...
+
+$template = <<'EOTEMPLATE';
+[%- USE e = Clickable::Email -%]
+[% text | $e %]
+EOTEMPLATE
+
+$output = '';
+
+$tt->process(\$template, { text => 'text nik at FreeBSD.org text' }, \$output);
+
+is($output, $expected_output, 'Works inline');

Added: branches/upstream/libtemplate-plugin-clickable-email-perl/current/t/pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtemplate-plugin-clickable-email-perl/current/t/pod.t?rev=50095&op=file
==============================================================================
--- branches/upstream/libtemplate-plugin-clickable-email-perl/current/t/pod.t (added)
+++ branches/upstream/libtemplate-plugin-clickable-email-perl/current/t/pod.t Sun Jan  3 22:54:15 2010
@@ -1,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();




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