Changeset 2288

Show
Ignore:
Timestamp:
06/21/07 04:14:11
Author:
miyagawa
Message:

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

=== Changes
==================================================================
--- Changes (revision 6804)
+++ Changes (local)
@@ -1,5 +1,9 @@

Revision history for Perl extension Class
Trigger.

+0.11_03 Wed Jun 20 12:12:36 PDT 2007
+ - Fixed a bug in backward-compatiblity code to handle multiple
+ hooks in one add_trigger() call. (Thanks to mark addison)
+

0.11_02 Sun Jun 10 18:09:58 PDT 2007

- Added a test to make sure $_ is not clobbered

(Thanks to mark addison)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Class-Trigger/trunk/Changes

    r2286 r2288  
    11Revision history for Perl extension Class::Trigger. 
     2 
     30.11_03  Wed Jun 20 12:12:36 PDT 2007 
     4    - Fixed a bug in backward-compatiblity code to handle multiple 
     5      hooks in one add_trigger() call. (Thanks to mark addison) 
    26 
    370.11_02  Sun Jun 10 18:09:58 PDT 2007 
  • Class-Trigger/trunk/lib/Class/Trigger.pm

    r2286 r2288  
    33use strict; 
    44use vars qw($VERSION); 
    5 $VERSION = "0.11_02"; 
     5$VERSION = "0.11_03"; 
    66 
    77use Carp (); 
     
    2828    my %params = @_; 
    2929    my @values = values %params; 
    30     if (@_ > 2 && grep { ref && ref eq 'CODE' } @values == @values) { 
     30    if (@_ > 2 && (grep { ref && ref eq 'CODE' } @values) == @values) { 
    3131        Carp::croak "mutiple trigger registration in one add_trigger() call is deprecated."; 
    3232    } 
  • Class-Trigger/trunk/t/01_trigger.t

    r1517 r2288  
    5454    like(pop(@die), qr(add_trigger[(][)] needs coderef at ), 'check for right callback param'); 
    5555} 
     56{ 
     57    # pass a multiple triggers and catch the carp 
     58 
     59    my @die; 
     60 
     61    eval { 
     62       local $SIG{__DIE__} = sub {push @die, @_}; 
     63 
     64       Foo->add_trigger(hello => sub{}, world => sub{}); 
     65    }; 
     66 
     67    like(pop(@die), qr(mutiple trigger registration in one add_trigger[(][)] call is deprecated.), 'check for depricated multi-trigger add'); 
     68}