This is an automated email from the git hooks/post-receive script. dmn pushed a commit to branch dam-bundle-2.0 in repository libcatalyst-modules-perl.
commit 9a67d46acd3d865f51903d6f44aa51415edae8f9 Author: Damyan Ivanov <d...@debian.org> Date: Thu May 8 10:17:13 2014 +0000 Update Catalyst-Plugin-Authentication-Store-DBIx-Class to 0.1506 --- .../Changes | 5 +++++ .../lib/Catalyst/Authentication/Realm/SimpleDB.pm | 2 +- .../Catalyst/Authentication/Store/DBIx/Class.pm | 4 ++-- .../Authentication/Store/DBIx/Class/User.pm | 14 +++++++++----- .../t/10-user-autoload.t | 22 +++++++++++++++++++++- 5 files changed, 38 insertions(+), 9 deletions(-) diff --git a/sources/Catalyst-Authentication-Store-DBIx-Class/Changes b/sources/Catalyst-Authentication-Store-DBIx-Class/Changes index 31bceec..53cdcff 100644 --- a/sources/Catalyst-Authentication-Store-DBIx-Class/Changes +++ b/sources/Catalyst-Authentication-Store-DBIx-Class/Changes @@ -1,5 +1,10 @@ Revision history for Catalyst-Plugin-Authentication-Store-DBIx-Class +0.1506 2014-04-02 + * Fix doc bugs. RT#87372 + * Fix calling User->can() as a class method. RT#90715 + * Fix Catalyst tutorial link. RT#47043 + 0.1505 2013-06-10 * Fix RT#82944 - test fails on perl >= 5.17.3 diff --git a/sources/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Realm/SimpleDB.pm b/sources/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Realm/SimpleDB.pm index 1912d2e..d0c2a95 100644 --- a/sources/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Realm/SimpleDB.pm +++ b/sources/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Realm/SimpleDB.pm @@ -238,7 +238,7 @@ you can refer to the following: =over =item * -L<Catalyst::Manual::Tutorial::Authentication> +L<Catalyst::Manual::Tutorial> =item * L<Catalyst::Plugin::Authentication> diff --git a/sources/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Store/DBIx/Class.pm b/sources/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Store/DBIx/Class.pm index 1262d71..f0b616d 100644 --- a/sources/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Store/DBIx/Class.pm +++ b/sources/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Store/DBIx/Class.pm @@ -4,7 +4,7 @@ use strict; use warnings; use base qw/Class::Accessor::Fast/; -our $VERSION= "0.1505"; +our $VERSION= "0.1506"; BEGIN { @@ -92,7 +92,7 @@ Catalyst::Authentication::Store::DBIx::Class - A storage class for Catalyst Auth =head1 VERSION -This documentation refers to version 0.1503. +This documentation refers to version 0.1506. =head1 SYNOPSIS diff --git a/sources/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Store/DBIx/Class/User.pm b/sources/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Store/DBIx/Class/User.pm index 4e5319c..ffe5eec 100644 --- a/sources/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Store/DBIx/Class/User.pm +++ b/sources/Catalyst-Authentication-Store-DBIx-Class/lib/Catalyst/Authentication/Store/DBIx/Class/User.pm @@ -72,7 +72,7 @@ sub load { } ## User can provide an arrayref containing the arguments to search on the user class. - ## or even provide a prepared resultset, allowing maximum flexibility for user retreival. + ## or even provide a prepared resultset, allowing maximum flexibility for user retrieval. ## these options are only available when using the dbix_class authinfo hash. if ($dbix_class_config && exists($authinfo->{'result'})) { $self->_user($authinfo->{'result'}); @@ -261,7 +261,9 @@ sub can { my $self = shift; return $self->SUPER::can(@_) || do { my ($method) = @_; - if (not $self->_user) { + if (not ref $self) { + undef; + } elsif (not $self->_user) { undef; } elsif (my $code = $self->_user->can($method)) { sub { shift->_user->$code(@_) } @@ -279,6 +281,8 @@ sub AUTOLOAD { (my $method) = (our $AUTOLOAD =~ /([^:]+)$/); return if $method eq "DESTROY"; + return unless ref $self; + if (my $code = $self->_user->can($method)) { return $self->_user->$code(@_); } @@ -304,7 +308,7 @@ module. =head1 VERSION -This documentation refers to version 0.1503. +This documentation refers to version 0.1506. =head1 SYNOPSIS @@ -384,11 +388,11 @@ that method (probably in your schema file) =head2 AUTOLOAD -Delegates method calls to the underlieing user row. +Delegates method calls to the underlying user row. =head2 can -Delegates handling of the C<< can >> method to the underlieing user row. +Delegates handling of the C<< can >> method to the underlying user row. =head1 BUGS AND LIMITATIONS diff --git a/sources/Catalyst-Authentication-Store-DBIx-Class/t/10-user-autoload.t b/sources/Catalyst-Authentication-Store-DBIx-Class/t/10-user-autoload.t index 74b243d..451ee65 100644 --- a/sources/Catalyst-Authentication-Store-DBIx-Class/t/10-user-autoload.t +++ b/sources/Catalyst-Authentication-Store-DBIx-Class/t/10-user-autoload.t @@ -1,6 +1,7 @@ use strict; use warnings; use Test::More; +use Try::Tiny; use Catalyst::Authentication::Store::DBIx::Class::User; my $message = 'I exist'; @@ -11,9 +12,10 @@ my $message = 'I exist'; sub exists { $message } } +my $class = 'Catalyst::Authentication::Store::DBIx::Class::User'; my $o = bless({ _user => bless({}, 'My::Test'), -}, 'Catalyst::Authentication::Store::DBIx::Class::User'); +}, $class); is($o->exists, $message, 'AUTOLOAD proxies ok'); @@ -23,4 +25,22 @@ is($o->$meth, $message, 'can returns right coderef'); is($o->can('non_existent_method'), undef, 'can on non existent method returns undef'); +is($o->non_existent_method, undef, 'AUTOLOAD traps non existent method'); + +try { + is($class->can('non_existent_method'), undef, "can on non existent class method"); +} catch { + my $e = $_; + fail('can on non existent class method'); + diag("Got exception: $e"); +}; + +try { + is($class->non_existent_method, undef, 'AUTOLOAD traps non existent class method'); +} catch { + my $e = $_; + fail('AUTOLOAD traps non existent class method'); + diag("Got exception: $e"); +}; + done_testing; -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcatalyst-modules-perl.git _______________________________________________ Pkg-perl-cvs-commits mailing list Pkg-perl-cvs-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits