Show
Ignore:
Timestamp:
11/21/07 13:29:47 (14 months ago)
Author:
nyarla
Message:

lang/perl/Class-Hookable: I changed method names( filter_plugin -> filter_register_hook, dispatch_plugin -> filter_run_hook ). and I classified test files and POD.

Location:
lang/perl/Class-Hookable/trunk
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Class-Hookable/trunk/Changes

    r1132 r1878  
    11Revision history for Perl extension Class::Hookable 
     2 
     30.02  Wed Nov 11 13:00:00 JST 2007 
     4        * renamed 2 methods 
     5          filter_plugin     -> filter_register_hook 
     6          dispatch_plugin   -> filter_run_hook 
     7        - classified test files and POD. 
     8        - modified POD. 
    29 
    3100.01  Sat Nov  3 15:08:06 2007 
  • lang/perl/Class-Hookable/trunk/Makefile.PL

    r1614 r1878  
    99build_requires 'Test::More' ; 
    1010 
    11 tests 't/*.t'; 
     11tests 't/*.t t/*/*.t'; 
    1212 
    1313auto_include; 
  • lang/perl/Class-Hookable/trunk/lib/Class/Hookable.pm

    r1877 r1878  
    77use Scalar::Util(); 
    88 
    9 our $VERSION = '0.01'; 
     9our $VERSION = '0.02'; 
    1010 
    1111sub new { bless {}, shift } 
     
    3535        }; 
    3636 
    37         if ( $self->filter_plugin( $hook, $action ) ) { 
     37        if ( $self->filter_register_hook( $hook, $action ) ) { 
    3838            $self->hooks->{$hook} = [] 
    3939                if ( ref $self->hooks->{$hook} ne 'ARRAY' ); 
     
    4444} 
    4545 
    46 sub filter_plugin { 1 } 
     46sub filter_register_hook { 1 } 
    4747 
    4848sub registered_hooks { 
     
    141141 
    142142    for my $action ( $self->registered_plugins( $hook ) ) { 
    143         if ( $self->dispatch_plugin( $hook, $args, $action ) ) { 
     143        if ( $self->filter_run_hook( $hook, $args, $action ) ) { 
    144144            my $plugin = $action->{'plugin'}; 
    145145            my $result = $action->{'callback'}->( $plugin, $context, $args ); 
     
    163163} 
    164164 
    165 sub dispatch_plugin { 1 } 
     165sub filter_run_hook { 1 } 
    166166 
    167167sub context { 
     
    210210 
    211211This module was made by making reference to the hook mechanism of L<Plagger>. 
    212 I thank L<Tatsuhiko miyagawa|http://search.cpan.org/~miyagawa/> who made wonderful application. 
     212I thank Tatsuhiko Miyagawa who made wonderful application. 
    213213 
    214214=head1 BASIC METHOD 
     
    236236and one after that is specified by the order of C<'hook' =E<gt> \&callabck>. 
    237237 
    238 =head2 filter_plugin 
    239  
    240   sub filter_plugin { 
     238=head2 filter_register_hook 
     239 
     240  sub filter_register_hook { 
    241241      my ( $self, $hook, $action ) = @_; 
    242242      my ( $plugin, $callback ) = @{ $action }{qw( plugin callback )}; 
     
    394394This method is an alias of C<$hook-E<gt>run_hook( $hook, $args, 1, \&callback )>. 
    395395 
    396 =head2 dispatch_plugin 
    397  
    398   sub dispatch_plugin { 
     396=head2 filter_run_hook 
     397 
     398  sub filter_run_hook { 
    399399      my ( $self, $hook, $args, $action ) = @_; 
    400400      my ( $plugin, $callabck ) = @{ $action }{qw( plugin callback )}; 
     
    402402  } 
    403403 
    404 When calling a hook, this method does a dispatch of a plugin. 
     404When calling a hook, this method is filtered a plugin. 
    405405Argument are passed by the order of C<$hook>, C<$args>, C<$action>. 
    406406 
     
    449449=head1 AUTHOR 
    450450 
    451 Naoki Okamura (Nyarla) E<lt>thotep@nayrla.netE<gt> 
     451Original idea by Tatsuhiko Miyagawa L<http://search.cpan.org/~miyagawa> in L<Plagger> 
     452 
     453Code by Naoki Okamura (Nyarla) E<lt>thotep@nayrla.netE<gt> 
    452454 
    453455=head1 LICENSE 
  • lang/perl/Class-Hookable/trunk/t/01_register/00_register_hook.t

    r1876 r1878  
    2727{ 
    2828    no warnings 'redefine'; 
    29     *Class::Hookable::filter_plugin = sub { 0 }; 
     29    *Class::Hookable::filter_register_hook = sub { 0 }; 
    3030} 
    3131 
  • lang/perl/Class-Hookable/trunk/t/03_call/00_run_hook.t

    r1876 r1878  
    6363 
    6464no warnings 'redefine'; 
    65 *Class::Hookable::dispatch_plugin = sub { 
     65*Class::Hookable::filter_run_hook = sub { 
    6666    my ( $self, $hook, $args, $action ) = @_; 
    6767