Scheduler 0.03
Andy Grundman [Thu, 15 Dec 2005 21:05:27 +0000 (21:05 +0000)]
Changes
lib/Catalyst/Plugin/Scheduler.pm
t/08yaml.t

diff --git a/Changes b/Changes
index 77ba8a3..26788b9 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for Perl extension Catalyst::Plugin::Scheduler
 
+0.03    2005-12-15 16:00:00
+        - Fixed yaml_file option.
+
 0.02    2005-12-15 15:40:00
         - Fixed pod coverage.
         - Hide timezone warning unless logging is enabled.
index ccadeab..b84a977 100644 (file)
@@ -12,7 +12,7 @@ use Set::Scalar;
 use Storable qw/lock_store lock_retrieve/;
 use YAML;
 
-our $VERSION = '0.02';
+our $VERSION = '0.03';
 
 __PACKAGE__->mk_classdata( '_events' => [] );
 __PACKAGE__->mk_accessors('_event_state');
@@ -152,7 +152,7 @@ sub setup {
     $c->config->{scheduler}->{time_zone}   ||= $c->_detect_timezone();
     $c->config->{scheduler}->{state_file}  ||= $c->path_to('scheduler.state');
     $c->config->{scheduler}->{hosts_allow} ||= '127.0.0.1';
-    $c->config->{scheduler}->{yaml}        ||= $c->path_to('scheduler.yml');
+    $c->config->{scheduler}->{yaml_file}   ||= $c->path_to('scheduler.yml');
 
     $c->NEXT::setup(@_);
 }
@@ -166,10 +166,10 @@ sub _check_yaml {
         return if ( time - $c->_event_state->{last_check} < 60 );
     }
 
-    return unless -e $c->config->{scheduler}->{yaml};
+    return unless -e $c->config->{scheduler}->{yaml_file};
 
     eval {
-        my $mtime = ( stat $c->config->{scheduler}->{yaml} )->mtime;
+        my $mtime = ( stat $c->config->{scheduler}->{yaml_file} )->mtime;
         if ( $mtime > $c->_event_state->{yaml_mtime}->{$$} ) {
             $c->_event_state->{yaml_mtime}->{$$} = $mtime;
             $c->_save_event_state();
@@ -177,7 +177,7 @@ sub _check_yaml {
             # wipe out all current events and reload from YAML
             $c->_events( [] );
 
-            my $yaml = YAML::LoadFile( $c->config->{scheduler}->{yaml} );
+            my $yaml = YAML::LoadFile( $c->config->{scheduler}->{yaml_file} );
 
             foreach my $event ( @{$yaml} ) {
                 $c->schedule( %{$event} );
@@ -609,7 +609,7 @@ being run in the event.
 =head2 schedule
 
 Schedule is a class method for adding scheduled events.  See the
-L<"/SCHEDULING> section for more information.
+L<"/SCHEDULING"> section for more information.
 
 =head1 INTERNAL METHODS
 
index b3e48cb..6d7d7ea 100644 (file)
@@ -18,7 +18,8 @@ my $state = { last_check => 0 };
 lock_store $state, $STATE;
 
 # configure a yaml file
-TestApp->config->{scheduler}->{yaml} = "$FindBin::Bin/lib/TestApp/test.yml";
+TestApp->config->{scheduler}->{yaml_file} 
+    = "$FindBin::Bin/lib/TestApp/test.yml";
 
 # test that the plugin event executes
 {