POE-Component-Schedule-0.95000755001750001750 011377033621 15506 5ustar00dolmendolmen000000000000POE-Component-Schedule-0.95/META.yml000444001750001750 142011377033621 17111 0ustar00dolmendolmen000000000000--- abstract: 'Schedule POE events using DateTime::Set iterators' author: - 'Olivier Mengué ' build_requires: Test::More: 0 configure_requires: Module::Build: 0.36 generated_by: 'Module::Build version 0.3603' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: POE-Component-Schedule provides: POE::Component::Schedule: file: lib/POE/Component/Schedule.pm version: 0.95 requires: DateTime: 0.48 DateTime::Set: 0.25 DateTime::TimeZone: 1.13 POE: 1.287 resources: bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=POE-Component-Schedule homepage: http://code.google.com/p/poe-component-schedule/ repository: http://poe-component-schedule.googlecode.com/svn/trunk/ version: 0.95 POE-Component-Schedule-0.95/Changes000444001750001750 1152211377033621 17157 0ustar00dolmendolmen000000000000Revision history for POE-Component-Schedule 0.95 2010-05-25T22:36+02:00 DOLMEN (Olivier Mengué) No changes since 0.94_03. Only change since 0.94 is fix for RT#56447 (allow POE aliases as target session ID for events). 0.94_03 2010-05-25T00:14+02:00 DOLMEN (Olivier Mengué) No functional change since 0.94_01. Fixed constant functions: added "()" prototype to make them inlinable by perl. Should have been like that since 0.91_01. That should improve performance. Added .perlcriticrc to disable Perl::Critic policies that do not match our style (filled RT#57638, RT#57639, RT#57640, RT#57807 for issues with default policies). Made some suggestions from Perl::Critic. Reduced number of lines, so improved test coverage ratio. Test coverage: 94.5%. Author build system: fixed the 'Build tag'. Author build system: improved steps to publish 'Changes.rss' in the Google Code wiki area. 0.94_02 2010-05-18T01:02+02:00 DOLMEN (Olivier Mengué) Author build system: Changes.{rss,yml} generation is now automated by extending Module::Build (see 'inc/MY/Build.pm' and 'inc/MY/Build/Changes.pm'). Added 't/90-critic.t' to 'MANIFEST.SKIP' as it is the main cause of CPAN Testers failures. Author build system: Drop 'Makefile.PL' generation by Module::Build. Author build system: Transformed 'make-svn-tag.pl' into a Build target ('tag'). 0.94_01 2010-05-09T19:44+02:00 DOLMEN (Olivier Mengué) RT#56447 fixed, but I expect to unapply the fix once RT#57314 (allow aliases in $poe_kernel->refcount_{in,de}crement) is implemented. Test cases added. Bug references are now linked in 'Changes.rss'. Test coverage: 91.6%. 0.94 2010-03-13T16:37+01:00 DOLMEN (Olivier Mengué) Only minor POD changes in Schedule.pm since 0.93_02. Increased dependencies versions. Small tweak to the 'Changes' file format to make it more parseable and be able to generate 'Changes.yml' and 'Changes.rss'. Added 'Changes.rss' and 'Changes.yml', generated from 'Changes' using either 'make-Changes-rss.pl' or 'make-Changes-rss-2.pl' (see SVN repo). Test coverage: 92.1%. 0.93_02 2010-02-13T16:30+01:00 DOLMEN (Olivier Mengué) More test coverage, but still only 92.1%. Help still welcome for RT#53925. Improved argument check for ->add() (and now, with tests too). POE >= 1.281 is recommended as it fixes the _child(lose) issue. Updated POD: removed obsolete warnings, updated copyright. Updated README: should be more helpful for distribution packagers. 0.93_01 2010-02-13T01:55+01:00 DOLMEN (Olivier Mengué) Applied fix for RT#53925 (Patch by Zeph Gillen). Added t/50-subclass.t to try to catch subclassing problems which may affect POE::Component::Cron. Unfortunately it does not catch RT#53925. Help needed. Added strictures in tests. Updated 'MANIFEST.SKIP' to match new Module::Build: ignore MYMETA.yml. 0.92 2009-11-20T19:17+01:00 DOLMEN (Olivier Mengué) Official Release. Have to review doc before 1.00. Fixed my local YAML.pm to have correct encoding of 'META.yml'. 0.91_01 2009-11-19T20:55+01:00 DOLMEN (Olivier Mengué) Major internal rewrite. No external changes. I love TDD! Now the scheduling session is detached from the session from which the session was spawned. This should help to avoid session attachment/references problems as the scheduler is not anymore attached to a particular session. Note that due to a POE bug, _child(lose) is still fired. Fixed typos in example code. kthakore++ TODO: add a test that extracts test code from the SYNOPSIS POD section and runs it. Maybe using Test::Pod::Snippets. 0.03 2009-06-16T19:10+02:00 DOLMEN (Olivier Mengué) Major improvement of POD. Fixed sample code. Improved test suite to check session reference counting. Added DESTROY handler for schedule handles to automatically delete handles which are not anymore referenced. Deprecated ->delete(). 0.02 2009-06-15T23:09+02:00 DOLMEN (Olivier Mengué) Changed the default session alias to $class. Fixed warning in Schedule.pm about new() not being used. Improved test suite to increase code coverage (added 11-two.t). Improved documentation for spawn(). Thanks to Rob Fugina for discussion. 0.01 2009-06-05T19:56+02:00 DOLMEN (Olivier Mengué) First release to the world, with Chris Fedde's blessing. This a fork of POE::Component::Cron 0.019. See RT#44442. POE-Component-Schedule-0.95/.project000444001750001750 57311377033621 17277 0ustar00dolmendolmen000000000000 POE-Component-Schedule org.epic.perleditor.perlbuilder org.epic.perleditor.perlnature POE-Component-Schedule-0.95/README000444001750001750 174711377033621 16534 0ustar00dolmendolmen000000000000 POE::Component::Schedule - Schedule POE events using DateTime::Set iterators This perl module is a POE component that sends events to POE client sessions on a schedule defined by a DateTime::Set iterator. INSTALLATION To install this module, run the following commands: perl Build.PL ./Build ./Build test ./Build install DEPENDENCIES (see META.yml for latest information) SUPPORT AND DOCUMENTATION After installing, you can find documentation for this module with the perldoc command. perldoc POE::Component::Schedule You can also view the documentation of the latest release online: http://search.cpan.org/dist/POE-Component-Schedule/lib/POE/Component/Schedule.pm COPYRIGHT & LICENCE Copyright (C) 2009-2010 Olivier Mengué Copyright (C) 2007-2008 Chris Fedde This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available. POE-Component-Schedule-0.95/.includepath000444001750001750 14711377033621 20126 0ustar00dolmendolmen000000000000 POE-Component-Schedule-0.95/Build.PL000444001750001750 300111377033621 17131 0ustar00dolmendolmen000000000000#!/usr/bin/env perl use utf8; # vim:set ts=4 sw=4: use strict; use warnings; use Module::Build; my $build_module = 'Module::Build'; # Use the extended build only in author environment if (-d '.svn' || ! -e 'Changes.rss') { print "Building in author mode for extended distmeta (to build Changes.rss)\n"; $build_module = 'inc::MY::Build'; require inc::MY::Build; } my $builder = $build_module->new( module_name => 'POE::Component::Schedule', dist_author => 'Olivier Mengué ', license => 'perl', meta_add => { resources => { homepage => 'http://code.google.com/p/poe-component-schedule/', repository => 'http://poe-component-schedule.googlecode.com/svn/trunk/', bugtracker => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=POE-Component-Schedule', }, }, requires => { # PoCoSchedule is known to work on 1.006 # But requiring lastest should fix most problems. # And we don't have anymore the constraint that the last POE available # on ActivePerl was 1.006. 'POE' => '1.287', 'DateTime' => '0.48', # Major fixes in this release 'DateTime::Set' => '0.25', 'DateTime::TimeZone' => '1.13', # Latest # HP-UX requires a plugin for local TZ detection ($^O eq 'hpux' ? ('DateTime::TimeZone::HPUX' => '1.04') : () ), }, build_requires => { 'Test::More' => 0, }, ); $builder->create_build_script(); POE-Component-Schedule-0.95/Changes.rss000444001750001750 3165511377033621 17776 0ustar00dolmendolmen000000000000 POE-Component-Schedule releases http://search.cpan.org/dist/POE-Component-Schedule/ Revision history for POE-Component-Schedule en-us 2010-05-25T22:37:07+02:00 Olivier Mengué <dolmen@cpan.org> weekly POE-Component-Schedule 0.95 http://search.cpan.org/~dolmen/POE-Component-Schedule-0.95/ <ul> <li>No changes since 0.94_03.</li> <li>Only change since 0.94 is fix for <a href="https://rt.cpan.org/Public/Bug/Display.html?id=56447" title="Bug RT#56447">RT#56447</a> (allow POE aliases as target session ID for events).</li> </ul> Olivier Mengué <dolmen@cpan.org> 2010-05-25T22:36+02:00 POE-Component-Schedule 0.94_03 http://search.cpan.org/~dolmen/POE-Component-Schedule-0.94_03/ <ul> <li>No functional change since 0.94_01.</li> <li>Fixed constant functions: added "()" prototype to make them inlinable by perl. Should have been like that since 0.91_01. That should improve performance.</li> <li>Added .perlcriticrc to disable Perl::Critic policies that do not match our style (filled <a href="https://rt.cpan.org/Public/Bug/Display.html?id=57638" title="Bug RT#57638">RT#57638</a>, <a href="https://rt.cpan.org/Public/Bug/Display.html?id=57639" title="Bug RT#57639">RT#57639</a>, <a href="https://rt.cpan.org/Public/Bug/Display.html?id=57640" title="Bug RT#57640">RT#57640</a>, <a href="https://rt.cpan.org/Public/Bug/Display.html?id=57807" title="Bug RT#57807">RT#57807</a> for issues with default policies).</li> <li>Made some suggestions from Perl::Critic. Reduced number of lines, so improved test coverage ratio.</li> <li>Test coverage: 94.5%.</li> <li>Author build system: fixed the 'Build tag'.</li> <li>Author build system: improved steps to publish 'Changes.rss' in the Google Code wiki area.</li> </ul> Olivier Mengué <dolmen@cpan.org> 2010-05-25T00:14+02:00 POE-Component-Schedule 0.94_02 http://search.cpan.org/~dolmen/POE-Component-Schedule-0.94_02/ <ul> <li>Author build system: Changes.{rss,yml} generation is now automated by extending Module::Build (see 'inc/MY/Build.pm' and 'inc/MY/Build/Changes.pm').</li> <li>Added 't/90-critic.t' to 'MANIFEST.SKIP' as it is the main cause of CPAN Testers failures.</li> <li>Author build system: Drop 'Makefile.PL' generation by Module::Build.</li> <li>Author build system: Transformed 'make-svn-tag.pl' into a Build target ('tag').</li> </ul> Olivier Mengué <dolmen@cpan.org> 2010-05-18T01:02+02:00 POE-Component-Schedule 0.94_01 http://search.cpan.org/~dolmen/POE-Component-Schedule-0.94_01/ <ul> <li><a href="https://rt.cpan.org/Public/Bug/Display.html?id=56447" title="Bug RT#56447">RT#56447</a> fixed, but I expect to unapply the fix once <a href="https://rt.cpan.org/Public/Bug/Display.html?id=57314" title="Bug RT#57314">RT#57314</a> (allow aliases in $poe_kernel->refcount_{in,de}crement) is implemented. Test cases added.</li> <li>Bug references are now linked in 'Changes.rss'.</li> <li>Test coverage: 91.6%.</li> </ul> Olivier Mengué <dolmen@cpan.org> 2010-05-09T19:44+02:00 POE-Component-Schedule 0.94 http://search.cpan.org/~dolmen/POE-Component-Schedule-0.94/ <ul> <li>Only minor POD changes in Schedule.pm since 0.93_02.</li> <li>Increased dependencies versions.</li> <li>Small tweak to the 'Changes' file format to make it more parseable and be able to generate 'Changes.yml' and 'Changes.rss'.</li> <li>Added 'Changes.rss' and 'Changes.yml', generated from 'Changes' using either 'make-Changes-rss.pl' or 'make-Changes-rss-2.pl' (see SVN repo).</li> <li>Test coverage: 92.1%.</li> </ul> Olivier Mengué <dolmen@cpan.org> 2010-03-13T16:37+01:00 POE-Component-Schedule 0.93_02 http://search.cpan.org/~dolmen/POE-Component-Schedule-0.93_02/ <ul> <li>More test coverage, but still only 92.1%. Help still welcome for <a href="https://rt.cpan.org/Public/Bug/Display.html?id=53925" title="Bug RT#53925">RT#53925</a>.</li> <li>Improved argument check for ->add() (and now, with tests too).</li> <li>POE >= 1.281 is recommended as it fixes the _child(lose) issue.</li> <li>Updated POD: removed obsolete warnings, updated copyright.</li> <li>Updated README: should be more helpful for distribution packagers.</li> </ul> Olivier Mengué <dolmen@cpan.org> 2010-02-13T16:30+01:00 POE-Component-Schedule 0.93_01 http://search.cpan.org/~dolmen/POE-Component-Schedule-0.93_01/ <ul> <li>Applied fix for <a href="https://rt.cpan.org/Public/Bug/Display.html?id=53925" title="Bug RT#53925">RT#53925</a> (Patch by Zeph Gillen).</li> <li>Added t/50-subclass.t to try to catch subclassing problems which may affect POE::Component::Cron. Unfortunately it does not catch <a href="https://rt.cpan.org/Public/Bug/Display.html?id=53925" title="Bug RT#53925">RT#53925</a>. Help needed.</li> <li>Added strictures in tests.</li> <li>Updated 'MANIFEST.SKIP' to match new Module::Build: ignore MYMETA.yml.</li> </ul> Olivier Mengué <dolmen@cpan.org> 2010-02-13T01:55+01:00 POE-Component-Schedule 0.92 http://search.cpan.org/~dolmen/POE-Component-Schedule-0.92/ <ul> <li>Official Release. Have to review doc before 1.00.</li> <li>Fixed my local YAML.pm to have correct encoding of 'META.yml'.</li> </ul> Olivier Mengué <dolmen@cpan.org> 2009-11-20T19:17+01:00 POE-Component-Schedule 0.91_01 http://search.cpan.org/~dolmen/POE-Component-Schedule-0.91_01/ <ul> <li>Major internal rewrite. No external changes. I love TDD!</li> <li>Now the scheduling session is detached from the session from which the session was spawned. This should help to avoid session attachment/references problems as the scheduler is not anymore attached to a particular session. Note that due to a POE bug, _child(lose) is still fired.</li> <li>Fixed typos in example code. kthakore++</li> <li>TODO: add a test that extracts test code from the SYNOPSIS POD section and runs it. Maybe using Test::Pod::Snippets.</li> </ul> Olivier Mengué <dolmen@cpan.org> 2009-11-19T20:55+01:00 POE-Component-Schedule 0.03 http://search.cpan.org/~dolmen/POE-Component-Schedule-0.03/ <ul> <li>Major improvement of POD. Fixed sample code.</li> <li>Improved test suite to check session reference counting.</li> <li>Added DESTROY handler for schedule handles to automatically delete handles which are not anymore referenced.</li> <li>Deprecated ->delete().</li> </ul> Olivier Mengué <dolmen@cpan.org> 2009-06-16T19:10+02:00 POE-Component-Schedule 0.02 http://search.cpan.org/~dolmen/POE-Component-Schedule-0.02/ <ul> <li>Changed the default session alias to $class.</li> <li>Fixed warning in Schedule.pm about new() not being used.</li> <li>Improved test suite to increase code coverage (added 11-two.t).</li> <li>Improved documentation for spawn().</li> <li>Thanks to Rob Fugina for discussion.</li> </ul> Olivier Mengué <dolmen@cpan.org> 2009-06-15T23:09+02:00 POE-Component-Schedule 0.01 http://search.cpan.org/~dolmen/POE-Component-Schedule-0.01/ <ul> <li>First release to the world, with Chris Fedde's blessing.</li> <li>This a fork of POE::Component::Cron 0.019. See <a href="https://rt.cpan.org/Public/Bug/Display.html?id=44442" title="Bug RT#44442">RT#44442</a>.</li> </ul> Olivier Mengué <dolmen@cpan.org> 2009-06-05T19:56+02:00 POE-Component-Schedule-0.95/MANIFEST.SKIP000444001750001750 44211377033621 17521 0ustar00dolmendolmen000000000000^Build.bat$ ^Build$ ^Makefile$ ^_build\b ^blib\b ^cover_db\b ~$ \.swp$ \.bak$ \.old$ \.old\.pl$ \.log$ \.tmp$ \bcore$ \B\.svn\b ^POE-Component-Schedule-* ^a.out$ ^MYMETA.yml$ ^make-svn-tag.pl$ ^make-Changes-rss.pl$ ^make-Changes-rss-2.pl$ \b90-kwalitee.t$ \b90-critic.t$ Debian_CPANTS.txt$ POE-Component-Schedule-0.95/.perlcriticrc000444001750001750 142411377033621 20332 0ustar00dolmendolmen000000000000# Perl Critic config for POE::Component::Schedule # Copyright (c) 2010 Olivier Mengué # CVS is old school [-Miscellanea::RequireRcsKeywords] # See RT#57638, RT#57640 [-Subroutines::RequireFinalReturn] # See RT#57638 [-Perl::Critic::Policy::Subroutines::ProhibitSubroutinePrototypes] # Disable due to POE style # RT#57639 [Subroutines::RequireArgUnpacking] allow_subscripts = 1 # I like 'unless' [-ControlStructures::ProhibitUnlessBlocks] # I like postfix [-ControlStructures::ProhibitPostfixControls] # I like Perl's advanced boolean operators [-ValuesAndExpressions::ProhibitMixedBooleanOperators] [Variables::ProhibitPunctuationVars] allow = $! $^O # 'no warning' is useful, but must be restricted [TestingAndDebugging::ProhibitNoWarnings] allow_with_category_restriction = 1 POE-Component-Schedule-0.95/MANIFEST000444001750001750 104311377033621 16772 0ustar00dolmendolmen000000000000.includepath .perlcriticrc .project .settings/org.eclipse.core.resources.prefs Build.PL Changes Changes.rss Changes.yml inc/MY/Build.pm inc/MY/Build/Changes.pm lib/POE/Component/Schedule.pm MANIFEST This list of files MANIFEST.SKIP META.yml README t/00-load.t t/01-pod.t t/02-pod-coverage.t t/10-basic.t t/11-two.t t/12-session-ref-1.t t/13-session-ref-2.t t/14-session-ref-3.t t/15-timers.t t/16-alias.t t/17-shutdown.t t/18-args-add.t t/20-session-arg-id.t t/21-session-arg-alias.t t/50-subclass.t t/90-meta.t t/90-minimumversion.t t/90-pod.t POE-Component-Schedule-0.95/Changes.yml000444001750001750 1261411377033621 17762 0ustar00dolmendolmen000000000000--- Header: Revision history for POE-Component-Schedule Releases: - Author_Id: DOLMEN Author_Name: Olivier Mengué Changes: - No changes since 0.94_03. - Only change since 0.94 is fix for RT#56447 (allow POE aliases as target session ID for events). DateTime: 2010-05-25T22:36+02:00 Version: 0.95 - Author_Id: DOLMEN Author_Name: Olivier Mengué Changes: - No functional change since 0.94_01. - 'Fixed constant functions: added "()" prototype to make them inlinable by perl. Should have been like that since 0.91_01. That should improve performance.' - 'Added .perlcriticrc to disable Perl::Critic policies that do not match our style (filled RT#57638, RT#57639, RT#57640, RT#57807 for issues with default policies).' - 'Made some suggestions from Perl::Critic. Reduced number of lines, so improved test coverage ratio.' - 'Test coverage: 94.5%.' - "Author build system: fixed the 'Build tag'." - "Author build system: improved steps to publish 'Changes.rss' in the Google Code wiki area." DateTime: 2010-05-25T00:14+02:00 Version: 0.94_03 - Author_Id: DOLMEN Author_Name: Olivier Mengué Changes: - "Author build system: Changes.{rss,yml} generation is now automated by extending Module::Build (see 'inc/MY/Build.pm' and 'inc/MY/Build/Changes.pm')." - Added 't/90-critic.t' to 'MANIFEST.SKIP' as it is the main cause of CPAN Testers failures. - "Author build system: Drop 'Makefile.PL' generation by Module::Build." - "Author build system: Transformed 'make-svn-tag.pl' into a Build target ('tag')." DateTime: 2010-05-18T01:02+02:00 Version: 0.94_02 - Author_Id: DOLMEN Author_Name: Olivier Mengué Changes: - 'RT#56447 fixed, but I expect to unapply the fix once RT#57314 (allow aliases in $poe_kernel->refcount_{in,de}crement) is implemented. Test cases added.' - Bug references are now linked in 'Changes.rss'. - 'Test coverage: 91.6%.' DateTime: 2010-05-09T19:44+02:00 Version: 0.94_01 - Author_Id: DOLMEN Author_Name: Olivier Mengué Changes: - Only minor POD changes in Schedule.pm since 0.93_02. - Increased dependencies versions. - Small tweak to the 'Changes' file format to make it more parseable and be able to generate 'Changes.yml' and 'Changes.rss'. - "Added 'Changes.rss' and 'Changes.yml', generated from 'Changes' using either 'make-Changes-rss.pl' or 'make-Changes-rss-2.pl' (see SVN repo)." - 'Test coverage: 92.1%.' DateTime: 2010-03-13T16:37+01:00 Version: 0.94 - Author_Id: DOLMEN Author_Name: Olivier Mengué Changes: - 'More test coverage, but still only 92.1%. Help still welcome for RT#53925.' - 'Improved argument check for ->add() (and now, with tests too).' - POE >= 1.281 is recommended as it fixes the _child(lose) issue. - 'Updated POD: removed obsolete warnings, updated copyright.' - 'Updated README: should be more helpful for distribution packagers.' DateTime: 2010-02-13T16:30+01:00 Version: 0.93_02 - Author_Id: DOLMEN Author_Name: Olivier Mengué Changes: - Applied fix for RT#53925 (Patch by Zeph Gillen). - Added t/50-subclass.t to try to catch subclassing problems which may affect POE::Component::Cron. Unfortunately it does not catch RT#53925. Help needed. - Added strictures in tests. - "Updated 'MANIFEST.SKIP' to match new Module::Build: ignore MYMETA.yml." DateTime: 2010-02-13T01:55+01:00 Version: 0.93_01 - Author_Id: DOLMEN Author_Name: Olivier Mengué Changes: - Official Release. Have to review doc before 1.00. - Fixed my local YAML.pm to have correct encoding of 'META.yml'. DateTime: 2009-11-20T19:17+01:00 Version: 0.92 - Author_Id: DOLMEN Author_Name: Olivier Mengué Changes: - Major internal rewrite. No external changes. I love TDD! - 'Now the scheduling session is detached from the session from which the session was spawned. This should help to avoid session attachment/references problems as the scheduler is not anymore attached to a particular session. Note that due to a POE bug, _child(lose) is still fired.' - Fixed typos in example code. kthakore++ - 'TODO: add a test that extracts test code from the SYNOPSIS POD section and runs it. Maybe using Test::Pod::Snippets.' DateTime: 2009-11-19T20:55+01:00 Version: 0.91_01 - Author_Id: DOLMEN Author_Name: Olivier Mengué Changes: - Major improvement of POD. Fixed sample code. - Improved test suite to check session reference counting. - Added DESTROY handler for schedule handles to automatically delete handles which are not anymore referenced. - Deprecated ->delete(). DateTime: 2009-06-16T19:10+02:00 Version: 0.03 - Author_Id: DOLMEN Author_Name: Olivier Mengué Changes: - Changed the default session alias to $class. - Fixed warning in Schedule.pm about new() not being used. - Improved test suite to increase code coverage (added 11-two.t). - Improved documentation for spawn(). - Thanks to Rob Fugina for discussion. DateTime: 2009-06-15T23:09+02:00 Version: 0.02 - Author_Id: DOLMEN Author_Name: Olivier Mengué Changes: - "First release to the world, with Chris Fedde's blessing." - This a fork of POE::Component::Cron 0.019. See RT#44442. DateTime: 2009-06-05T19:56+02:00 Version: 0.01 POE-Component-Schedule-0.95/inc000755001750001750 011377033621 16257 5ustar00dolmendolmen000000000000POE-Component-Schedule-0.95/inc/MY000755001750001750 011377033621 16604 5ustar00dolmendolmen000000000000POE-Component-Schedule-0.95/inc/MY/Build.pm000444001750001750 551611377033621 20345 0ustar00dolmendolmen000000000000use strict; package inc::MY::Build; use Module::Build; our @ISA; BEGIN { push @ISA, 'Module::Build'; } sub ACTION_distmeta { my $self = shift; $self->SUPER::depends_on('distrss'); $self->SUPER::ACTION_distmeta; } # Override 'dist' to force a 'distcheck' # (this is unfortunately not the default in M::B, which means it let you build # and distribute a distribution which has an incorrect MANIFEST and lacks some # files) sub ACTION_dist { my $self = shift; $self->SUPER::depends_on('distcheck'); $self->SUPER::ACTION_dist; } sub ACTION_tag { my $self = shift; my $version = $self->dist_version; my $tag = "release-$version"; my ($trunk, $repo, $revision); local %ENV; $ENV{LANG} = 'C'; open(my $svn_info, 'svn info|') or die "Can't run 'svn info: $!'"; while (<$svn_info>) { chomp; /^URL: (.*)$/ and $trunk = $1; } close $svn_info; die "'URL' not found in 'svn info' output " unless $trunk; open($svn_info, "svn info $trunk|") or die "Can't run 'svn info $trunk: $!'"; while (<$svn_info>) { chomp; /^Repository Root: (.*)$/ and $repo = $1; /^Last Changed Rev: (\d+)/ and $revision = $1; } close $svn_info; die "'Repository Root' or 'Last Changed Rev' not found in 'svn info' output " unless $repo && $revision; # TODO Check if the tag already exists print "Creating tag '$tag' from revision $revision\n"; my $cmd = qq|svn copy $trunk $repo/tags/$tag -m "CPAN release $version from r$revision."|; print "$cmd\n"; if ($self->y_n("Do it?", 'n')) { system $cmd; } else { printf "Abort.\n"; return 1; } } sub ACTION_distrss { my $self = shift; $self->do_create_Changes_RSS; } sub do_create_Changes_RSS { my $self = shift; print "Creating Changes.{rss,yml}\n"; my %deps = ( 'DateTime' => '0.53', 'Regexp::Grammars' => '1.002', 'Data::Recursive::Encode' => '0.03', 'DateTime::Format::W3CDTF' => '0.04', 'YAML' => '0.71', 'XML::RSS' => '1.47', #'Toto' => '3', ); my $ok = 1; while (my ($mod, $ver) = each %deps) { unless ($self->check_installed_version($mod, $ver)) { $self->log_warn("missing module $mod $ver"); $ok = 0; } } die "Can't build Changes.{rss,yml}" unless $ok; #system $^X $^X, 'make-Changes-rss-2.pl'; require inc::MY::Build::Changes; inc::MY::Build::Changes->build(dist_name => $self->dist_name); # Prepare Changes.rss online distribution in the wiki of the Google Code # project require File::Spec; my $f = File::Spec->catfile('..', $self->dist_name.".wiki", 'Changes.rss'); if (-e $f) { require File::Copy; File::Copy::syscopy('Changes.rss', $f); } } 1; __END__ =head1 ACTIONS =over 4 =item distrss Creates 'Changes.rss' and 'Changes.yml' from 'Changes'. =item tag Makes the Subversion tag for the release. =back =cut POE-Component-Schedule-0.95/inc/MY/Build000755001750001750 011377033621 17643 5ustar00dolmendolmen000000000000POE-Component-Schedule-0.95/inc/MY/Build/Changes.pm000555001750001750 1005311377033621 21730 0ustar00dolmendolmen000000000000 use utf8; use v5.10.0; use strict; package inc::MY::Build::Changes; require DateTime; sub build { my $self = shift; my %args = @_; my $input = 'Changes'; my $Changes_dt = DateTime->from_epoch(epoch => (stat $input)[9], time_zone => 'local'); my $Changes = $self->parse($input); #use Data::Dumper; #print Dumper(\%Changes), "\n"; $self->write_YAML("$input.yml", $Changes, %args, last_update => $Changes_dt); utime $Changes_dt->epoch, $Changes_dt->epoch, "$input.yml"; $self->write_RSS("$input.rss", $Changes, %args, last_update => $Changes_dt); utime $Changes_dt->epoch, $Changes_dt->epoch, "$input.rss"; } sub parse { my $self = shift; my $input_file = shift; my $Changes = do { # See http://rt.cpan.org/Ticket/Display.html?id=54819#txn-736810 #open my $fd, "<:utf8", $input_file; open my $fd, "<:raw", $input_file; local $/ = undef; <$fd>; }; #print $Changes; my $parser = do { use Regexp::Grammars; qr{ \A \R*
<[Releases=Release]>+ (?: # Should be at end of input... \Z | # If not, report the fact but don't fail... ) \S \V+ (?: \R \V+ )* \R+ \h+ \h+ \h+ \( \) \R <[Changes]>+ \d+ \. \d+ (?: _ \d+ )? ( <.Date> (?: T <.Time> <.TimeZone>? )? ) \d{4}-\d{2}-\d{2} (\d{2}:\d{2}) Z | [+-]\d{2}:\d{2} \w+ [^)]+ (?:\t|[ ]{8}) (\S\V*) \R (?{ $MATCH = $CAPTURE }) (?: (?:\t[ ]{2}|\h{10}) \h* (\V+) \R (?{ $MATCH .= " ".$CAPTURE }) )* }xms; }; $Changes =~ $parser or die "format invalide !\n"; my %Changes = %{$/{'='}}; use Data::Recursive::Encode; # Workaround for the Perl crash: we decode UTF-8 after matching with R::G # http://rt.perl.org/rt3//Public/Bug/Display.html?id=72996 %Changes = %{ Data::Recursive::Encode->decode_utf8(\%Changes, Encode::FB_WARN) }; return \%Changes; } use YAML 0.71 (); sub write_YAML { my $self = shift; my $output_file = shift; my $Changes = shift; my %args = @_; #print YAML::Dump(\%Changes), "\n"; YAML::DumpFile($output_file, $Changes); } use XML::RSS; use DateTime::Format::W3CDTF; sub write_RSS { my $self = shift; my $output_file = shift; my %Changes = %{ (shift) }; my %args = @_; my $dist = $args{dist_name}; my $lastUpdate = $args{last_update}; my $rss = XML::RSS->new(version => '1.0'); $rss->channel( title => "$dist releases", description => $Changes{'Header'}, (map { $_ => "http://search.cpan.org/dist/$dist/" } qw/about link/), dc => { date => DateTime::Format::W3CDTF->new->format_datetime($lastUpdate), creator => "$Changes{Releases}[0]{Author_Name} <".lc($Changes{Releases}[0]{Author_Id}).'@cpan.org>', language => 'en-us', }, syn => { updatePeriod => 'weekly', }, taxo => [ 'http://dmoz.org/Computers/Programming/Languages/Perl/' ], ); sub changes_html { my $h = "
    \n".join('', map {"
  • $_
  • \n"} @_).'
'; $h =~ s{(RT#(\d+))}{$1}g; $h } for my $r (@{$Changes{'Releases'}}) { my $link = 'http://search.cpan.org/~'.lc($r->{Author_Id})."/$dist-$r->{Version}/"; $rss->add_item( title => "$dist $r->{Version}", about => $link, link => $link, description => changes_html(@{$r->{Changes}}), dc => { creator => "$r->{Author_Name} <".lc($r->{Author_Id}).'@cpan.org>', date => "$r->{DateTime}", } ); } open my $Changes_rss, '>:utf8', $output_file; print $Changes_rss $rss->as_string; close $Changes_rss; } POE-Component-Schedule-0.95/lib000755001750001750 011377033621 16254 5ustar00dolmendolmen000000000000POE-Component-Schedule-0.95/lib/POE000755001750001750 011377033621 16677 5ustar00dolmendolmen000000000000POE-Component-Schedule-0.95/lib/POE/Component000755001750001750 011377033621 20641 5ustar00dolmendolmen000000000000POE-Component-Schedule-0.95/lib/POE/Component/Schedule.pm000444001750001750 2166511377033621 23122 0ustar00dolmendolmen000000000000package POE::Component::Schedule; use 5.008; use strict; use warnings; use Carp; our $VERSION = '0.95'; use POE; BEGIN { defined &DEBUG or *DEBUG = sub () { 0 }; } # Private properties of a schedule ticket sub PCS_TIMER () { 0 } # The POE timer sub PCS_ITERATOR () { 1 } # DateTime::Set iterator sub PCS_SESSION () { 2 } # POE session ID sub PCS_EVENT () { 3 } # Event name sub PCS_ARGS () { 4 } # Event args array # Private constant: # The name of the counter attached to each session # We use only one counter for all timers of one session # All instances of P::C::S will use the same counter for a given session sub REFCOUNT_COUNTER_NAME () { __PACKAGE__ } # Scheduling session ID # This session is a singleton my $BackEndSession; # Maps tickets IDs to tickets my %Tickets = (); my $LastTicketID = 'a'; # 'b' ... 'z', 'aa' ... # # crank up the schedule session # sub spawn { ## no critic (Subroutines::RequireArgUnpacking) if ( !defined $BackEndSession ) { my ($class, %arg) = @_; my $alias = $arg{Alias} || ref $class || $class; $BackEndSession = POE::Session->create( inline_states => { _start => sub { print "# $alias _start\n" if DEBUG; my ($k) = $_[KERNEL]; $k->detach_myself; $k->alias_set( $alias ); $k->sig( 'SHUTDOWN', 'shutdown' ); }, schedule => \&_schedule, client_event => \&_client_event, cancel => \&_cancel, shutdown => sub { print "# $alias shutdown\n" if DEBUG; my $k = $_[KERNEL]; # Remove all timers of our session # and decrement session references foreach my $alarm ($k->alarm_remove_all()) { my ($name, $time, $t) = @$alarm; $t->[PCS_TIMER] = undef; $k->refcount_decrement($t->[PCS_SESSION], REFCOUNT_COUNTER_NAME); } %Tickets = (); $k->sig_handled(); }, _stop => sub { print "# $alias _stop\n" if DEBUG; $BackEndSession = undef; }, }, )->ID; } return $BackEndSession; } # # schedule the next event # ARG0 is the schedule ticket # sub _schedule { my ( $k, $t ) = @_[ KERNEL, ARG0]; # # deal with DateTime::Sets that are finite # my $n = $t->[PCS_ITERATOR]->next; unless ($n) { # No more events, so release the session $k->refcount_decrement($t->[PCS_SESSION], REFCOUNT_COUNTER_NAME); $t->[PCS_TIMER] = undef; return; } $t->[PCS_TIMER] = $k->alarm_set( client_event => $n->epoch, $t ); return $t; } # # handle a client event and schedule the next one # ARG0 is the schedule ticket # sub _client_event { ## no critic (Subroutines::RequireArgUnpacking) my ( $k, $t ) = @_[ KERNEL, ARG0 ]; $k->post( @{$t}[PCS_SESSION, PCS_EVENT], @{$t->[PCS_ARGS]} ); return _schedule(@_); } # # cancel an alarm # sub _cancel { my ( $k, $t ) = @_[ KERNEL, ARG0 ]; if (defined($t->[PCS_TIMER])) { $k->alarm_remove($t->[PCS_TIMER]); $k->refcount_decrement($t->[PCS_SESSION], REFCOUNT_COUNTER_NAME); $t->[PCS_TIMER] = undef; } return; } # # Takes a POE::Session, an event name and a DateTime::Set # Returns a ticket object # sub add { my ( $class, $session, $event, $iterator, @args ) = @_; # Remember only the session ID $session = $poe_kernel->alias_resolve($session) unless ref $session; defined($session) or croak __PACKAGE__ . "->add: first arg must be an existing POE session ID or alias."; $session = $session->ID; # We don't want to loose the session until the event has been handled $poe_kernel->refcount_increment($session, REFCOUNT_COUNTER_NAME) > 0 or croak __PACKAGE__ . "->add: first arg must be an existing POE session ID or alias: $!"; ref $iterator && $iterator->isa('DateTime::Set') or croak __PACKAGE__ . "->add: third arg must be a DateTime::Set"; $class->spawn unless $BackEndSession; my $id = $LastTicketID++; my $ticket = $Tickets{$id} = [ undef, # Current alarm id $iterator, $session, $event, \@args, ]; $poe_kernel->post( $BackEndSession, schedule => $ticket); # We return a kind of smart pointer, so the schedule # can be simply destroyed by releasing its object reference return bless \$id, ref($class) || $class; } sub delete { my $id = ${$_[0]}; return unless exists $Tickets{$id}; $poe_kernel->post($BackEndSession, cancel => delete $Tickets{$id}); return; } # Releasing the ticket object will delete the ressource sub DESTROY { return $_[0]->delete; } { no warnings; *new = \&add; } 1; __END__ =head1 NAME POE::Component::Schedule - Schedule POE events using DateTime::Set iterators =head1 SYNOPSIS use POE qw(Component::Schedule); use DateTime::Set; POE::Session->create( inline_states => { _start => sub { $_[HEAP]{sched} = POE::Component::Schedule->add( $_[SESSION], Tick => DateTime::Set->from_recurrence( after => DateTime->now, before => DateTime->now->add(seconds => 3), recurrence => sub { return $_[0]->truncate( to => 'second' )->add( seconds => 1 ) }, ), ); }, Tick => sub { print 'tick ', scalar localtime, "\n"; }, remove_sched => sub { # Three ways to remove a schedule # The first one is only for API compatibility with POE::Component::Cron $_[HEAP]{sched}->delete; $_[HEAP]{sched} = undef; delete $_[HEAP]{sched}; }, _stop => sub { print "_stop\n"; }, }, ); POE::Kernel->run(); =head1 DESCRIPTION This component encapsulates a session that sends events to client sessions on a schedule as defined by a DateTime::Set iterator. =head1 POE::Component::Schedule METHODS =head2 spawn(Alias => I) Start up the PoCo::Schedule background session with the given alias. Returns the back-end session handle. No need to call this in normal use, C and C all crank one of these up if it is needed. =head2 add(I<$session>, I<$event_name>, I<$iterator>, I<@event_args>) my $sched = POE::Component::Schedule->add( $session, $event_name, $DateTime_Set_iterator, @event_args ); Add a set of events to the scheduler. Returns a schedule handle. The event is automatically deleted when the handle is not referenced anymore. =head2 new(I<$session>, I<$event_name>, I<$iterator>, I<@event_args>) C is an alias for C. =head1 SCHEDULE HANDLE METHODS =head2 delete() Removes a schedule using the handle returned from C or C. B: Schedules are now automatically deleted when they are not referenced anymore. So just setting the container variable to C will delete the schedule. =head1 SEE ALSO L, L, L. =head1 SUPPORT You can look for information at: =over 4 =item * RT: CPAN's request tracker L: post bug report there. =item * CPAN Ratings L: if you use this distibution, please add comments on your experience for other users. =item * Search CPAN L =item * AnnoCPAN: Annotated CPAN documentation L =back =head1 ACKNOWLEDGMENT & HISTORY This module was a friendly fork of L to extract the generic parts and isolate the Cron specific code in order to reduce dependencies on other CPAN modules. See L. The orignal author of POE::Component::Cron is Chris Fedde. POE::Component::Cron is now implemented as a class that inherits from POE::Component::Schedule. Most of the POE::Component::Schedule internals have since been rewritten in 0.91_01 and we have now a complete test suite. =head1 AUTHORS =over 4 =item Olivier MenguE, C<<< dolmen@cpan.org >>> =item Chris Fedde, C<<< cfedde@cpan.org >>> =back =head1 COPYRIGHT AND LICENSE =over 4 =item Copyright E 2009-2010 Olivier MenguE. =item Copyright E 2007-2008 Chris Fedde. =back This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available. =cut POE-Component-Schedule-0.95/.settings000755001750001750 011377033621 17424 5ustar00dolmendolmen000000000000POE-Component-Schedule-0.95/.settings/org.eclipse.core.resources.prefs000444001750001750 12611377033621 25753 0ustar00dolmendolmen000000000000#Fri Jun 05 18:20:49 CEST 2009 eclipse.preferences.version=1 encoding/=UTF-8 POE-Component-Schedule-0.95/t000755001750001750 011377033621 15751 5ustar00dolmendolmen000000000000POE-Component-Schedule-0.95/t/11-two.t000444001750001750 372011377033621 17325 0ustar00dolmendolmen000000000000use Test::More tests => 21; use POE; use POE::Component::Schedule; use DateTime; use DateTime::Set; my $max = 2; POE::Session->create( inline_states => { _start => sub { pass "_start"; my $tick_count = 3; my $tock_count = 1; POE::Component::Schedule->spawn(Alias => 'TickTock'); POE::Component::Schedule->spawn(); # Second call to reach 100% test coverage $_[HEAP]{Tick} = POE::Component::Schedule->add( $_[SESSION], Clock => DateTime::Set->from_recurrence( after => DateTime->now->add( seconds => 1), recurrence => sub { return $_[0]->truncate( to => 'second' )->add( seconds => 1 ) }, ), 'Tick', \$tick_count ); $_[HEAP]{Tock} = POE::Component::Schedule->add( $_[SESSION] => Clock => DateTime::Set->from_recurrence( after => DateTime->now->add( seconds => 1), recurrence => sub { return $_[0]->truncate( to => 'second' )->add( seconds => 2 ) }, ), 'Tock', \$tock_count ); }, Clock => sub { # ARG0 : schedule name # ARG1 : schedule counter reference is($#_ - ARG0, 1, $_[STATE].' arg count'); my ($s, $rc) = @_[ARG0, ARG1]; like($s, qr/^(?:Tick|Tock)$/, "ARG0"); is(ref $rc, 'SCALAR', "ARG1 type"); diag "$s ".$$rc; ok($$rc > 0, "ARG1 > 0"); diag scalar localtime; if (--$$rc == 0) { pass "delete $s"; $_[HEAP]{$s}->delete; delete $_[HEAP]{$s}; } }, _stop => sub { pass "_stop"; }, }, ); $poe_kernel->run(); pass "Stopped";POE-Component-Schedule-0.95/t/02-pod-coverage.t000444001750001750 111711377033621 21065 0ustar00dolmendolmen000000000000use warnings; use strict; use Test::More; # Ensure a recent version of Test::Pod::Coverage my $min_tpc = 1.08; eval "use Test::Pod::Coverage $min_tpc"; plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage" if $@; # Test::Pod::Coverage doesn't require a minimum Pod::Coverage version, # but older versions don't recognize some common documentation styles my $min_pc = 0.18; eval "use Pod::Coverage $min_pc"; plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" if $@; all_pod_coverage_ok({ also_private => [ qr/^[A-Z_]+$/ ], }); POE-Component-Schedule-0.95/t/21-session-arg-alias.t000444001750001750 312411377033621 22034 0ustar00dolmendolmen000000000000#!/usr/local/bin/perl # Test derived from 14-session-ref-3.t # Test creating a schedule giving to P::C::S a session alias (instead of a # session object). use strict; use warnings; use Test::More tests => 16; use POE qw(Component::Schedule); use DateTime::Set; sub SESS_ALIAS { "session-arg-alias" } POE::Session->create( inline_states => { _start => sub { $poe_kernel->alias_set(SESS_ALIAS); pass "_start"; diag scalar localtime; $_[HEAP]{count} = 3; $poe_kernel->yield('create_schedule'); }, create_schedule => sub { cmp_ok $_[HEAP]{count}, '>', 0, "Create schedule ".$_[HEAP]{count}; $_[HEAP]{sched} = POE::Component::Schedule->add( SESS_ALIAS, Tick => DateTime::Set->from_recurrence( # Infinite set after => DateTime->now, recurrence => sub { return $_[0]->add( seconds => 1 ) }, ), [ 2 ], # Tick counter storage ); }, Tick => sub { cmp_ok($_[ARG0]->[0], '>', 0, 'Tick '.$_[ARG0]->[0].' > 0'); diag scalar localtime; if (--$_[ARG0]->[0] == 0) { pass "Kill schedule"; delete $_[HEAP]{sched}; $poe_kernel->yield('create_schedule') if --$_[HEAP]{count} > 0; } }, _stop => sub { pass "_stop"; is $_[HEAP]{count}, 0, "count is 0"; }, }, ); POE::Kernel->run(); pass "Stopped"; POE-Component-Schedule-0.95/t/10-basic.t000444001750001750 241011377033621 17567 0ustar00dolmendolmen000000000000use strict; use warnings; use Test::More tests => 13; use POE; use POE::Component::Schedule; use DateTime; use DateTime::Set; my $max = 2; POE::Session->create( inline_states => { _start => sub { pass "_start"; $_[HEAP]{count} = $max; $_[HEAP]{sched} = POE::Component::Schedule->add( $_[SESSION] => Tick => DateTime::Set->from_recurrence( after => DateTime->now->add( seconds => 1), recurrence => sub { return $_[0]->truncate( to => 'second' )->add( seconds => 1 ) }, ), 'my_ticket', 1, 2, ); }, Tick => sub { pass "Tick " . --$_[HEAP]{count}; diag scalar localtime; is($#_ - ARG0, 2, 'arg count'); is($_[ARG0], 'my_ticket', "ARG0"); is($_[ARG1], 1, "ARG1"); is($_[ARG2], 2, "ARG2"); if ($_[HEAP]{count} == 0) { diag "delete schedule"; $_[HEAP]{sched}->delete; delete $_[HEAP]{sched}; } }, _stop => sub { pass "_stop"; }, }, ); $poe_kernel->run(); pass "Stopped"; POE-Component-Schedule-0.95/t/50-subclass.t000444001750001750 270611377033621 20341 0ustar00dolmendolmen000000000000use strict; use warnings; { package POE::Component::Schedule::MySubClass; #use POE::Component::Schedule; use base 'POE::Component::Schedule'; 1; } use Test::More tests => 14; use POE; use DateTime; use DateTime::Set; my $max = 2; POE::Session->create( inline_states => { _start => sub { pass "_start"; $_[HEAP]{count} = $max; $_[HEAP]{sched} = POE::Component::Schedule::MySubClass->add( $_[SESSION] => Tick => DateTime::Set->from_recurrence( after => DateTime->now->add( seconds => 1), recurrence => sub { return $_[0]->truncate( to => 'second' )->add( seconds => 1 ) }, ), 'my_ticket', 1, 2, ); isa_ok($_[HEAP]{sched}, 'POE::Component::Schedule::MySubClass'); }, Tick => sub { pass "Tick " . --$_[HEAP]{count}; diag scalar localtime; is($#_ - ARG0, 2, 'arg count'); is($_[ARG0], 'my_ticket', "ARG0"); is($_[ARG1], 1, "ARG1"); is($_[ARG2], 2, "ARG2"); if ($_[HEAP]{count} == 0) { diag "delete schedule"; $_[HEAP]{sched}->delete; delete $_[HEAP]{sched}; } }, _stop => sub { pass "_stop"; }, }, ); $poe_kernel->run(); pass "Stopped"; POE-Component-Schedule-0.95/t/12-session-ref-1.t000444001750001750 313411377033621 21107 0ustar00dolmendolmen000000000000#!/usr/local/bin/perl use strict; use warnings; use Test::More tests => 6; use POE qw(Component::Schedule); use DateTime::Set; # The only events in this session are the ones generated be PoCo::Schedule # So we verify that the session refcount is automatically increased/decreased # when a schedule is created/destroyed. POE::Session->create( inline_states => { _start => sub { pass "_start"; diag scalar localtime; $_[HEAP]{sched} = POE::Component::Schedule->add( $_[SESSION], Tick => DateTime::Set->from_recurrence( start => DateTime->now->truncate(to => 'second'), # When there is no more event in the iterator, the schedule # will be deleted, so the session ref count will be decreased # so the session will end. before => DateTime->now->add(seconds => 3)->truncate(to => 'second'), recurrence => sub { return $_[0]->add( seconds => 1 ) }, ), ); }, Tick => sub { pass "Tick"; diag scalar localtime; }, _stop => sub { pass "_stop"; # The schedule has automatically been removed as there is no more # events in the iterator # We check that deleting the object does not break $_[HEAP]{sched}->delete; # Also garbage collection should delete $_[HEAP]{sched}; }, }, ); POE::Kernel->run(); pass "Stopped"; POE-Component-Schedule-0.95/t/90-meta.t000444001750001750 116311377033621 17450 0ustar00dolmendolmen000000000000#!/usr/bin/perl # Test that our META.yml file matches the specification use strict; BEGIN { $| = 1; $^W = 1; } my @MODULES = ( 'Test::CPAN::Meta 0.12', ); # Don't run tests during end-user installs use Test::More; unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) { plan( skip_all => "Author tests not required for installation" ); } # Load the testing modules foreach my $MODULE ( @MODULES ) { eval "use $MODULE"; if ( $@ ) { $ENV{RELEASE_TESTING} ? die( "Failed to load required release-testing module $MODULE" ) : plan( skip_all => "$MODULE not available for testing" ); } } meta_yaml_ok(); 1; POE-Component-Schedule-0.95/t/90-minimumversion.t000444001750001750 126611377033621 21607 0ustar00dolmendolmen000000000000#!/usr/bin/perl # Test that our declared minimum Perl version matches our syntax use strict; BEGIN { $| = 1; $^W = 1; } my @MODULES = ( 'Perl::MinimumVersion 1.20', 'Test::MinimumVersion 0.008', ); # Don't run tests during end-user installs use Test::More; unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) { plan( skip_all => "Author tests not required for installation" ); } # Load the testing modules foreach my $MODULE ( @MODULES ) { eval "use $MODULE"; if ( $@ ) { $ENV{RELEASE_TESTING} ? die( "Failed to load required release-testing module $MODULE" ) : plan( skip_all => "$MODULE not available for testing" ); } } all_minimum_version_from_metayml_ok(); 1; POE-Component-Schedule-0.95/t/15-timers.t000444001750001750 320311377033621 20017 0ustar00dolmendolmen000000000000use Test::More tests => 12; # This test check that standard timers can be used aside P::C::S events sub POE::Component::Schedule::DEBUG() { 1 } use POE qw(Component::Schedule); use DateTime; use DateTime::Set; my $end_timer_fired = 0; POE::Session->create( inline_states => { _start => sub { pass "_start"; $poe_kernel->delay(EndTimer => 4); my $tick_count = 2; $_[HEAP]{Tick} = POE::Component::Schedule->add( $_[SESSION], Clock => DateTime::Set->from_recurrence( after => DateTime->now->add( seconds => 1), recurrence => sub { return $_[0]->truncate( to => 'second' )->add( seconds => 1 ) }, ), 'Tick', \$tick_count ); }, Clock => sub { # ARG0 : schedule name # ARG1 : schedule counter reference is($#_ - ARG0, 1, $_[STATE].' arg count'); my ($s, $rc) = @_[ARG0, ARG1]; is(ref $rc, 'SCALAR', "ARG1 type"); diag "$s ".$$rc; ok($$rc > 0, "ARG1 > 0"); diag scalar localtime; if (--$$rc == 0) { pass "delete $s"; $_[HEAP]{$s}->delete; delete $_[HEAP]{$s}; } }, EndTimer => sub { $end_timer_fired++; pass "EndTimer"; diag scalar localtime; }, _stop => sub { pass "_stop"; }, }, ); $poe_kernel->run(); pass "Stopped"; ok($end_timer_fired, "EndTimer fired"); POE-Component-Schedule-0.95/t/17-shutdown.t000444001750001750 205711377033621 20377 0ustar00dolmendolmen000000000000use strict; $| = 1; use Test::More tests => 4; sub POE::Kernel::ASSERT_DEFAULT () { 1 } #BEGIN { # package POE::Kernel; # use constant TRACE_DEFAULT => exists($INC{'Devel/Cover.pm'}); #} use POE 'Component::Schedule'; use DateTime; use DateTime::Set; my $pcs_session = POE::Component::Schedule->spawn; POE::Session->create( inline_states => { _start => sub { pass "_start"; $_[HEAP] = POE::Component::Schedule->add( $_[SESSION]->ID => Tick => DateTime::Set->from_recurrence( after => DateTime->now->add( seconds => 1), recurrence => sub { return $_[0]->truncate( to => 'second' )->add( seconds => 1 ) }, ), 'my_ticket', 1, 2, ); }, Tick => sub { pass "Tick"; $_[KERNEL]->post($pcs_session, 'shutdown'); }, _stop => sub { pass "_stop"; }, }, ); POE::Kernel->run(); pass "Stopped"; POE-Component-Schedule-0.95/t/01-pod.t000444001750001750 35011377033621 17251 0ustar00dolmendolmen000000000000#!perl -T use warnings; use strict; use Test::More; # Ensure a recent version of Test::Pod my $min_tp = 1.22; eval "use Test::Pod $min_tp"; plan skip_all => "Test::Pod $min_tp required for testing POD" if $@; all_pod_files_ok(); POE-Component-Schedule-0.95/t/90-pod.t000444001750001750 120611377033621 17302 0ustar00dolmendolmen000000000000#!/usr/bin/perl # Test that the syntax of our POD documentation is valid use strict; BEGIN { $| = 1; $^W = 1; } my @MODULES = ( 'Pod::Simple 3.07', 'Test::Pod 1.26', ); # Don't run tests during end-user installs use Test::More; unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) { plan( skip_all => "Author tests not required for installation" ); } # Load the testing modules foreach my $MODULE ( @MODULES ) { eval "use $MODULE"; if ( $@ ) { $ENV{RELEASE_TESTING} ? die( "Failed to load required release-testing module $MODULE" ) : plan( skip_all => "$MODULE not available for testing" ); } } all_pod_files_ok(); 1; POE-Component-Schedule-0.95/t/13-session-ref-2.t000444001750001750 216411377033621 21113 0ustar00dolmendolmen000000000000#!/usr/local/bin/perl use strict; use warnings; use Test::More tests => 6; use POE qw(Component::Schedule); use DateTime::Set; POE::Session->create( inline_states => { _start => sub { pass "_start"; diag scalar localtime; $_[HEAP]{count} = 2; $_[HEAP]{sched} = POE::Component::Schedule->add( $_[SESSION], Tick => DateTime::Set->from_recurrence( # Infinite set after => DateTime->now, recurrence => sub { return $_[0]->add( seconds => 1 ) }, ), ); }, Tick => sub { cmp_ok($_[HEAP]{count}, '>', 0, 'Tick '.$_[HEAP]{count}.' > 0'); diag scalar localtime; if (--$_[HEAP]{count} == 0) { pass "Kill schedule"; # Once we delete the last schedule, we expect the session to stop delete $_[HEAP]{sched}; } }, _stop => sub { pass "_stop"; }, }, ); POE::Kernel->run(); pass "Stopped"; POE-Component-Schedule-0.95/t/14-session-ref-3.t000444001750001750 257311377033621 21121 0ustar00dolmendolmen000000000000#!/usr/local/bin/perl use strict; use warnings; use Test::More tests => 16; use POE qw(Component::Schedule); use DateTime::Set; POE::Session->create( inline_states => { _start => sub { pass "_start"; diag scalar localtime; $_[HEAP]{count} = 3; $poe_kernel->yield('create_schedule'); }, create_schedule => sub { cmp_ok $_[HEAP]{count}, '>', 0, "Create schedule ".$_[HEAP]{count}; $_[HEAP]{sched} = POE::Component::Schedule->add( $_[SESSION], Tick => DateTime::Set->from_recurrence( # Infinite set after => DateTime->now, recurrence => sub { return $_[0]->add( seconds => 1 ) }, ), [ 2 ], # Tick counter storage ); }, Tick => sub { cmp_ok($_[ARG0]->[0], '>', 0, 'Tick '.$_[ARG0]->[0].' > 0'); diag scalar localtime; if (--$_[ARG0]->[0] == 0) { pass "Kill schedule"; delete $_[HEAP]{sched}; $poe_kernel->yield('create_schedule') if --$_[HEAP]{count} > 0; } }, _stop => sub { pass "_stop"; is $_[HEAP]{count}, 0, "count is 0"; }, }, ); POE::Kernel->run(); pass "Stopped"; POE-Component-Schedule-0.95/t/18-args-add.t000444001750001750 125111377033621 20202 0ustar00dolmendolmen000000000000use strict; $| = 1; use POE 'Component::Schedule'; use Test::More tests => 6; my $s; # Check arg0: POE::Session eval { $s = POE::Component::Schedule->add('none', 'tick', 3); is($s, undef, "no ticket created"); }; like($@, qr/^POE::Component::Schedule->add: first arg must be an existing POE session ID or alias/, "arg0 check"); is($s, undef, "no ticket created"); # Check arg2: DateTime::Set for my $v (3, $poe_kernel) { $s = undef; eval { $s = POE::Component::Schedule->add($poe_kernel, 'tick', 3); }; like($@, qr/^POE::Component::Schedule->add: third arg must be a DateTime::Set /, "arg2 check"); is($s, undef, "no ticket created"); } POE-Component-Schedule-0.95/t/16-alias.t000444001750001750 106111377033621 17606 0ustar00dolmendolmen000000000000use strict; use warnings; use Test::More tests => 5; sub POE::Component::Schedule::DEBUG { 1 } use POE 'Component::Schedule'; my $alias = 'Scheduler'; my $ses = POE::Component::Schedule->spawn(Alias => $alias); is(POE::Kernel->alias_list($ses), $alias, "Alias check"); POE::Kernel->run; $ses = POE::Component::Schedule->spawn; isnt(POE::Kernel->alias_list($ses), $alias, "Alias check"); POE::Kernel->run; pass; $ses = POE::Component::Schedule->spawn(Alias => $alias); is(POE::Kernel->alias_list($ses), $alias, "Alias check"); POE::Kernel->run; pass; POE-Component-Schedule-0.95/t/20-session-arg-id.t000444001750001750 300411377033621 21333 0ustar00dolmendolmen000000000000#!/usr/local/bin/perl # Test derived from 14-session-ref-3.t # Test creating a schedule giving to P::C::S a session ID (instead of a session # object). use strict; use warnings; use Test::More tests => 16; use POE qw(Component::Schedule); use DateTime::Set; POE::Session->create( inline_states => { _start => sub { pass "_start"; diag scalar localtime; $_[HEAP]{count} = 3; $poe_kernel->yield('create_schedule'); }, create_schedule => sub { cmp_ok $_[HEAP]{count}, '>', 0, "Create schedule ".$_[HEAP]{count}; $_[HEAP]{sched} = POE::Component::Schedule->add( $_[SESSION]->ID, Tick => DateTime::Set->from_recurrence( # Infinite set after => DateTime->now, recurrence => sub { return $_[0]->add( seconds => 1 ) }, ), [ 2 ], # Tick counter storage ); }, Tick => sub { cmp_ok($_[ARG0]->[0], '>', 0, 'Tick '.$_[ARG0]->[0].' > 0'); diag scalar localtime; if (--$_[ARG0]->[0] == 0) { pass "Kill schedule"; delete $_[HEAP]{sched}; $poe_kernel->yield('create_schedule') if --$_[HEAP]{count} > 0; } }, _stop => sub { pass "_stop"; is $_[HEAP]{count}, 0, "count is 0"; }, }, ); POE::Kernel->run(); pass "Stopped"; POE-Component-Schedule-0.95/t/00-load.t000444001750001750 35511377033621 17412 0ustar00dolmendolmen000000000000#!perl -T use warnings; use strict; use Test::More tests => 1; BEGIN { use_ok( 'POE::Component::Schedule' ); } diag( "Testing POE::Component::Schedule ".POE::Component::Schedule->VERSION.", POE ".POE->VERSION.", Perl $], $^X" );