Changeset 2385

Show
Ignore:
Timestamp:
10/27/07 05:31:55
Author:
miyagawa
Message:

Checking in changes prior to tagging of version 0.02. Changelog diff is:

=== Changes
==================================================================
--- Changes (revision 1164)
+++ Changes (local)
@@ -1,4 +1,8 @@

Revision history for Perl extension Template::Plugin
Shuffle

+0.02 Fri Oct 26 13:30:57 PDT 2007
+ - Use define_vmethod API so it works with Template::Alloy
+ (Thanks to Paul Seamons)
+

0.01 Fri Apr 18 16:17:01 2003
- original version

Files:

Legend:

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

    r882 r2385  
    11Revision history for Perl extension Template::Plugin::Shuffle 
     2 
     30.02  Fri Oct 26 13:30:57 PDT 2007 
     4        - Use define_vmethod API so it works with Template::Alloy 
     5          (Thanks to Paul Seamons) 
    26 
    370.01  Fri Apr 18 16:17:01 2003 
  • Template-Plugin-Shuffle/trunk/lib/Template/Plugin/Shuffle.pm

    r882 r2385  
    33use strict; 
    44use vars qw($VERSION); 
    5 $VERSION = 0.01
     5$VERSION = "0.02"
    66 
    77use base qw(Template::Plugin); 
     
    1010use Algorithm::Numerical::Shuffle qw(shuffle); 
    1111 
    12 $Template::Stash::LIST_OPS->{shuffle} = sub { 
    13     return [ shuffle(@{$_[0]}) ]; 
    14 }; 
     12sub new { 
     13    my ($pkg, $context, @args) = @_; 
     14    $context->define_vmethod('LIST', shuffle => sub { 
     15                                 return [ shuffle(@{$_[0]}) ]; 
     16                             }); 
     17    return $pkg->SUPER::new($context, @args); 
     18
    1519 
    16201;