CPAN::YACSmoke::Plugin::Phalanx100 - Test Phalanx 100 list in CPAN::YACSmoke


CPAN-YACSmoke-Plugin-Phalanx100 documentation Contained in the CPAN-YACSmoke-Plugin-Phalanx100 distribution.

Index


Code Index:

NAME

Top

  CPAN::YACSmoke::Plugin::Phalanx100 - Test Phalanx 100 list in CPAN::YACSmoke

SYNOPSIS

Top

  use CPAN::YACSmoke;
  my $config = {
      list_from        => 'Phalanx100', 
  };
  my $foo = CPAN::YACSmoke->new(config => $config);
  my @list = $foo->download_list();

DESCRIPTION

Top

This module provides the backend ability to test modules from the Phalanx 100 list.

This module should be used together with CPAN::YACSmoke.

CONSTRUCTOR

Top

new()

Creates the plugin object.

METHODS

Top

download_list()

Return the list of distributions recorded in the latest RECENT file.

CAVEATS

Top

This is a proto-type release. Use with caution and supervision.

AUTHOR

Top

Robert Rothenberg <rrwo at cpan.org>

Suggestions and Bug Reporting

Please submit suggestions and report bugs to the CPAN Bug Tracker at http://rt.cpan.org.

COPYRIGHT AND LICENSE

Top

SEE ALSO

Top

  Module::Phalanx100


CPAN-YACSmoke-Plugin-Phalanx100 documentation Contained in the CPAN-YACSmoke-Plugin-Phalanx100 distribution.
package CPAN::YACSmoke::Plugin::Phalanx100;

use 5.006001;
use strict;
use warnings;

our $VERSION = '0.02';

use CPANPLUS::Backend;

use CPAN::YACSmoke 0.03;
use Module::Phalanx100 0.03;

# use YAML 'Dump';

    
sub new {
  my $class = shift || __PACKAGE__;
  my $hash  = shift;

  my $self = {
  };
  foreach my $field (qw( smoke force )) {
    $self->{$field} = $hash->{$field}   if(exists $hash->{$field});
  }

  bless $self, $class;
}

sub download_list {
  my $self  = shift;

  my @list = Module::Phalanx100->modules();

  my $cpan = $self->{smoke}->{cpan};

  my %testlist = ( );
  foreach my $modname (@list) {
    my $mod = $cpan->parse_module( module => $modname );
    if ($mod) {
      my $pkgname = $mod->path .'/'. $mod->package;
      $pkgname =~ s/^authors\/id//i;
#      print STDERR Dump($mod), "\n";
      $testlist{$pkgname}++,
	unless ($mod->package_is_perl_core);
    } else {
      # TODO: warning message
    }
  }

  return (sort keys %testlist);
}


1;
__END__