Changeset 968

Show
Ignore:
Timestamp:
11/12/03 02:27:50
Author:
miyagawa
Message:

added finder_class to 0.04

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Template-Plugin-Clickable/trunk

    • Property svn:ignore set to Makefile blib pm_to_blib
  • Template-Plugin-Clickable/trunk/Changes

    r798 r968  
    11Revision history for Perl extension Template::Plugin::Clickable 
     2 
     30.04  Wed Nov 12 02:24:56 JST 2003 
     4        * Added filter_class option, thanks to Tony Bowden 
    25 
    360.03  Thu Nov 14 18:49:15 JST 2002 
  • Template-Plugin-Clickable/trunk/Makefile.PL

    r605 r968  
    66        'Test::More' => 0.32, 
    77        'Template'   => 2.07, 
    8         'URI::Find'  => 0.12, 
     8        'URI::Find'  => 0.13, 
     9        'UNIVERSAL::require' => 0, 
    910    }, 
    1011); 
  • Template-Plugin-Clickable/trunk/README

    r798 r968  
    2525        by default. 
    2626 
     27    finder_class 
     28        "finder_class" option enables you to set other URI finder class 
     29        rather than URI::Find (default). For example, 
     30 
     31          [% FILTER clickable finder_class => 'URU::Find::Schemeless' %] 
     32          Visit www.example.com/join right now! 
     33          [% END %] 
     34 
     35        this will become: 
     36 
     37          Visit <a href="http://www.example.com/join">www.example.com/join</a> right now! 
     38 
    2739NOTE 
    2840    If you use this module with "html" filter, you should set this 
     
    3749 
    3850SEE ALSO 
    39     the Template manpage, the URI::Find manpage 
     51    Template, URI::Find 
    4052 
  • Template-Plugin-Clickable/trunk/lib/Template/Plugin/Clickable.pm

    r798 r968  
    33use strict; 
    44use vars qw($VERSION); 
    5 $VERSION = 0.03
     5$VERSION = 0.04
    66 
    77require Template::Plugin; 
     
    1111$FILTER_NAME = 'clickable'; 
    1212 
    13 use URI::Find
     13use UNIVERSAL::require
    1414 
    1515sub new { 
     
    2727        return sub { 
    2828            my $text = shift; 
    29             my $finder = URI::Find->new( 
     29            my $finder_class = $config->{finder_class} || 'URI::Find'; 
     30            $finder_class->require or die $UNIVERSAL::require::ERROR; 
     31            my $finder = $finder_class->new( 
    3032                sub { 
    3133                    my($uri, $orig_uri) = @_; 
     
    4042    return [ $sub, 1 ]; 
    4143} 
    42  
    4344 
    44451; 
     
    7879by default. 
    7980 
     81=item finder_class 
     82 
     83C<finder_class> option enables you to set other URI finder class 
     84rather than URI::Find (default). For example, 
     85 
     86  [% FILTER clickable finder_class => 'URI::Find::Schemeless' %] 
     87  Visit www.example.com/join right now! 
     88  [% END %] 
     89 
     90this will become: 
     91 
     92  Visit <a href="http://www.example.com/join">www.example.com/join</a> right now! 
     93 
    8094=back 
    8195