[Catalyst-commits] r10959 - in
Catalyst-Authentication-Credential-FBConnect/branches/cleanup-moose:
. lib/Catalyst/Authentication/Credential
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Thu Jul 23 00:22:38 GMT 2009
Author: t0m
Date: 2009-07-23 00:22:37 +0000 (Thu, 23 Jul 2009)
New Revision: 10959
Modified:
Catalyst-Authentication-Credential-FBConnect/branches/cleanup-moose/Makefile.PL
Catalyst-Authentication-Credential-FBConnect/branches/cleanup-moose/lib/Catalyst/Authentication/Credential/FBConnect.pm
Log:
Type checking, we're only constructed once per app, so lets blow up nicely at the start if the config looks like bullshit
Modified: Catalyst-Authentication-Credential-FBConnect/branches/cleanup-moose/Makefile.PL
===================================================================
--- Catalyst-Authentication-Credential-FBConnect/branches/cleanup-moose/Makefile.PL 2009-07-23 00:15:53 UTC (rev 10958)
+++ Catalyst-Authentication-Credential-FBConnect/branches/cleanup-moose/Makefile.PL 2009-07-23 00:22:37 UTC (rev 10959)
@@ -3,6 +3,8 @@
name 'Catalyst-Authentication-Credential-FBConnect';
all_from 'lib/Catalyst/Authentication/Credential/FBConnect.pm';
+requires 'MooseX::Types';
+requires 'MooseX::Types::Common';
requires 'namespace::autoclean';
requires 'WWW::Facebook::API';
requires 'Moose';
Modified: Catalyst-Authentication-Credential-FBConnect/branches/cleanup-moose/lib/Catalyst/Authentication/Credential/FBConnect.pm
===================================================================
--- Catalyst-Authentication-Credential-FBConnect/branches/cleanup-moose/lib/Catalyst/Authentication/Credential/FBConnect.pm 2009-07-23 00:15:53 UTC (rev 10958)
+++ Catalyst-Authentication-Credential-FBConnect/branches/cleanup-moose/lib/Catalyst/Authentication/Credential/FBConnect.pm 2009-07-23 00:22:37 UTC (rev 10959)
@@ -1,26 +1,21 @@
package Catalyst::Authentication::Credential::FBConnect;
use Moose;
-use namespace::autoclean;
-
-has debug => ( is => 'ro' );
-has key => ( is => 'ro' );
-has secret => ( is => 'ro' );
-has app_name => ( is => 'ro' );
-has fbconnect => ( is => 'ro', lazy_build => 1, init_arg => undef );
-
-has realm => ( is => 'ro', required => 1, weak_ref => 1 );
-
+use MooseX::Types::Moose qw/ Bool /;
+use MooseX::Types::Common::String qw/ NonEmptySimpleStr /;
use WWW::Facebook::API;
use Catalyst::Exception ();
+use namespace::autoclean;
+has debug => ( is => 'ro', isa => Bool, );
+has key => ( is => 'ro', isa => NonEmptySimpleStr, required => 1 );
+has secret => ( is => 'ro', isa => NonEmptySimpleStr, required => 1 );
+has app_name => ( is => 'ro', isa => NonEmptySimpleStr, required => 1 );
+has fbconnect => ( is => 'ro', lazy_build => 1, init_arg => undef, isa => 'WWW::Facebook::API' );
+
sub BUILDARGS {
my ($class, $config, $c, $realm) = @_;
- return {
- %{ $config },
- %{ $realm->{config} }, # Ewww, gross hack to steal the realms config too.
- realm => $realm,
- };
+ return $config;
}
sub BUILD {
More information about the Catalyst-commits
mailing list