[Bps-public-commit] jifty-plugin-authentication-oauth branch, master, updated. 1cbae9e15e6bc13ecb386376a6e2b8b84c2eef15

Shawn Moore sartak at bestpractical.com
Fri Jun 4 08:52:33 EDT 2010


The branch, master has been updated
       via  1cbae9e15e6bc13ecb386376a6e2b8b84c2eef15 (commit)
      from  9a24c6bbf8983ce780698b724b6aad590dc53ff5 (commit)

Summary of changes:
 lib/Jifty/Plugin/Authentication/OAuth.pm |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 1cbae9e15e6bc13ecb386376a6e2b8b84c2eef15
Author: Shawn M Moore <sartak at gmail.com>
Date:   Fri Jun 4 08:53:16 2010 -0400

    Use accessors instead of a package %CONFIG

diff --git a/lib/Jifty/Plugin/Authentication/OAuth.pm b/lib/Jifty/Plugin/Authentication/OAuth.pm
index d59cd45..f70b636 100644
--- a/lib/Jifty/Plugin/Authentication/OAuth.pm
+++ b/lib/Jifty/Plugin/Authentication/OAuth.pm
@@ -23,7 +23,7 @@ Add the following to your F<etc/config.yml> under the C<framework> section:
 
 =cut
 
-our %CONFIG = ( );
+__PACKAGE__->mk_accessors(qw/consumer_key consumer_secret/);
 
 =head2 init
 
@@ -31,7 +31,16 @@ our %CONFIG = ( );
 
 sub init {
     my $self = shift;
-    %CONFIG  = @_;
+    my %args = @_;
+
+    for my $arg (keys %args) {
+        if ($self->can($arg)) {
+            $self->$arg($args{$arg});
+        }
+        else {
+            warn "Unknown argument: $arg";
+        }
+    }
 }
 
 =head1 AUTHOR

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list