POE::Component::CPAN::Reporter

Bringing the power of POE to CPAN smoke testing
Download

POE::Component::CPAN::Reporter Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Chris Williams
  • Publisher web site:
  • http://search.cpan.org/~bingos/

POE::Component::CPAN::Reporter Tags


POE::Component::CPAN::Reporter Description

Bringing the power of POE to CPAN smoke testing POE::Component::CPAN::Reporter is a POE-based framework around CPAN and CPAN::Reporter. This module receives submissions from other POE sessions, spawns a POE::Wheel::Run to deal with running CPAN::Reporter, captures the output and returns the results to the requesting session.Only one job request may be processed at a time. If a job is in progress, any jobs submitted are added to a pending jobs queue.By default the component uses POE::Wheel::Run to fork another copy of the currently executing perl, worked out from $^X. You can specify a different perl executable to use though. MSWin32 users please see the section of this document relating to your platform.You are responsible for installing and configuring CPAN and CPAN::Reporter and setting up a suitable perl smoking environment.SYNOPSIS use strict; use POE qw(Component::CPAN::Reporter Component::SmokeBox::Recent); use Getopt::Long; $|=1; my ($perl, $jobs, $recenturl); GetOptions( 'perl=s' => $perl, 'jobs=s' => $jobs, 'recenturl' => $recenturl ); my @pending; if ( $jobs ) { open my $fh, "< $jobs" or die "$jobs: $! "; while (< $fh >) { chomp; push @pending, $_; } close($fh); } my $smoker = POE::Component::CPAN::Reporter->spawn( alias => 'smoker' ); POE::Session->create( package_states = > , ], heap => { perl = > $perl, pending => @pending }, ); $poe_kernel->run(); exit 0; sub _start { my ($kernel,$heap) = @_; if ( @{ $heap->{pending} } ) { $kernel->post( 'smoker', 'submit', { event => '_results', perl => $heap->{perl}, module = > $_ } ) for @{ $heap->{pending} }; } else { POE::Component::SmokeBox::Recent->recent( url = > $recenturl || 'http://www.cpan.org/', event = > 'recent', ); $kernel->post( 'smoker', 'recent', { event = > '_recent', perl => $heap->{perl} } ) } undef; } sub _stop { $poe_kernel->call( 'smoker', 'shutdown' ); undef; } sub _results { my $job = $_; print STDOUT "Module: ", $job->{module}, " "; print STDOUT "$_ " for @{ $job->{log} }; undef; } sub _recent { my ($kernel,$heap,$job) = @_; die $job->{error}, " " if $job->{error}; $kernel->post( 'smoker', 'submit', { event = > '_results', perl = > $heap->{perl}, module = > $_ } ) for @{ $job->{recent} }; undef; } Requirements: · Perl


POE::Component::CPAN::Reporter Related Software