Template-Plugin-Clickable-Email-0.01000755 001751 001751 00000000000 10326421132 016656 5ustar00niknik000000 000000 Template-Plugin-Clickable-Email-0.01/t000755 001751 001751 00000000000 10326421132 017121 5ustar00niknik000000 000000 Template-Plugin-Clickable-Email-0.01/MANIFEST000644 001751 001751 00000000224 10326421132 020064 0ustar00niknik000000 000000 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 Template-Plugin-Clickable-Email-0.01/META.yml000644 001751 001751 00000000566 10326421132 020215 0ustar00niknik000000 000000 --- name: Template-Plugin-Clickable-Email version: 0.01 author: - Nik Clayton 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 Template-Plugin-Clickable-Email-0.01/lib000755 001751 001751 00000000000 10326421132 017424 5ustar00niknik000000 000000 Template-Plugin-Clickable-Email-0.01/Changes000644 001751 001751 00000000203 10326421132 020223 0ustar00niknik000000 000000 Revision history for Template-Plugin-Clickable-Email 0.01 Date/time First version, released on an unsuspecting world. Template-Plugin-Clickable-Email-0.01/README000644 001751 001751 00000004572 10326421132 017625 0ustar00niknik000000 000000 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 %]

Some text that contains an address: nik@FreeBSD.org.

[% 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, "" BUGS Please report any bugs or feature requests to "bug-template-plugin-clickable-email@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. 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. Template-Plugin-Clickable-Email-0.01/Build.PL000644 001751 001751 00000000767 10326421132 020243 0ustar00niknik000000 000000 use strict; use warnings; use Module::Build; my $builder = Module::Build->new( module_name => 'Template::Plugin::Clickable::Email', license => 'bsd', dist_author => 'Nik Clayton ', 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(); Template-Plugin-Clickable-Email-0.01/lib/Template000755 001751 001751 00000000000 10326421132 021177 5ustar00niknik000000 000000 Template-Plugin-Clickable-Email-0.01/lib/Template/Plugin000755 001751 001751 00000000000 10326421132 022435 5ustar00niknik000000 000000 Template-Plugin-Clickable-Email-0.01/lib/Template/Plugin/Clickable000755 001751 001751 00000000000 10326421132 024306 5ustar00niknik000000 000000 Template-Plugin-Clickable-Email-0.01/lib/Template/Plugin/Clickable/Email.pm000644 001751 001751 00000010127 10326421132 025753 0ustar00niknik000000 000000 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|$orig_email|; }, ); $finder->find(\$text); return $text; } =head1 SYNOPSIS [% USE link_emails = Clickable::Email %] Then [% text | $link_emails %] or [% FILTER $link_emails %]

Some text that contains an address: nik@FreeBSD.org.

[% END %] =head1 DESCRIPTION Template::Plugin::Clickable::Email converts any e-mail addresses found in the filtered text in to HTML C 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<< >> =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 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 Template-Plugin-Clickable-Email-0.01/t/01-filter.t000644 001751 001751 00000002007 10326421132 021067 0ustar00niknik000000 000000 #!/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@FreeBSD.org text [% END -%] EOTEMPLATE my $expected_output = <<'EOT'; text nik@FreeBSD.org 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@FreeBSD.org text' }, \$output); is($output, $expected_output, 'Works inline'); Template-Plugin-Clickable-Email-0.01/t/pod.t000644 001751 001751 00000000214 10326421132 020144 0ustar00niknik000000 000000 #!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(); Template-Plugin-Clickable-Email-0.01/t/00-load.t000644 001751 001751 00000000324 10326421132 020520 0ustar00niknik000000 000000 #!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" );