Scheduler, switch to Set::Scalar
Andy Grundman [Thu, 15 Dec 2005 20:24:09 +0000 (20:24 +0000)]
Build.PL
lib/Catalyst/Plugin/Scheduler.pm

index 67c7435..afb1ec6 100644 (file)
--- a/Build.PL
+++ b/Build.PL
@@ -8,7 +8,7 @@ my $build = Module::Build->new(
     requires           => { 
         'Catalyst'              => '5.61',
         'DateTime::Event::Cron' => 0,
-        'Set::Object'           => '1.14',
+        'Set::Scalar'           => 0,
         'Storable'              => 0,
         'YAML'                  => 0,
     },
index 535d761..6f92935 100644 (file)
@@ -8,7 +8,7 @@ use DateTime::Event::Cron;
 use DateTime::TimeZone;
 use File::stat;
 use NEXT;
-use Set::Object;
+use Set::Scalar;
 use Storable qw/lock_store lock_retrieve/;
 use YAML;
 
@@ -222,11 +222,8 @@ sub _event_authorized {
 
     my $hosts_allow = $c->config->{scheduler}->{hosts_allow};
     $hosts_allow = [$hosts_allow] unless ref($hosts_allow) eq 'ARRAY';
-
-    my $ip      = Set::Object->new( [ $c->req->address ] );
-    my $allowed = Set::Object->new( $hosts_allow );
-
-    return $ip->subset($allowed);
+    my $allowed = Set::Scalar->new( @{$hosts_allow} );
+    return $allowed->contains( $c->req->address );
 }
 
 # get the state from the state file