Skip to content

Commit

Permalink
added META.json, revised prerequisites, revised pingtest
Browse files Browse the repository at this point in the history
  • Loading branch information
barbie committed Oct 23, 2010
1 parent 1cdefbb commit e5920ef
Show file tree
Hide file tree
Showing 8 changed files with 159 additions and 23 deletions.
5 changes: 4 additions & 1 deletion Changes
@@ -1,11 +1,14 @@
Revision history for CPAN-Testers-WWW-Statistics

0.87 current
0.87 23/10/2010
- further domain patterns to ignore.
- bin/addresses.pl (0.15).
- simplification of state lookups.
- reduced data held in memory.
- reduced lookup time by storing data with each run.
- added META.json.
- revised META files and prerequisites.
- revised pingtest.

0.86 26/09/2010
- added Metabase and Labyrinth links.
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST
Expand Up @@ -2,6 +2,7 @@ Changes
data/01mailrc.txt
Makefile.PL
MANIFEST
META.json
META.yml
README
bin/addresses.pl
Expand Down Expand Up @@ -34,6 +35,7 @@ t/90podtest.t
t/91podcover.t
t/94metatest.t
t/95changedate.t
t/96metatest.t
t/CTWS_Testing.pm
t/data/21config00.ini
t/data/21config01.ini
Expand Down
96 changes: 96 additions & 0 deletions META.json
@@ -0,0 +1,96 @@
{
"name": "CPAN-Testers-WWW-Statistics",
"version": "0.87",
"abstract": "Scripts to create the CPAN Testers Statistics website",
"author": [
"Barbie (BARBIE) <barbie@cpan.org>"
],

"license": "artistic_2",
"dynamic_config" : 0,
"release_status" : "stable",
"meta-spec": {
"version": "2",
"url": "http://search.cpan.org/dist/CPAN-Meta/lib/CPAN/Meta/Spec.pm"
},
"generated_by": "Hand 1.0",
"keywords" : [
"qa",
"cpan",
"testing"
],

"prereqs" : {
"runtime" : {
"requires" : {
"CGI": "0",
"Class::Accessor::Fast": "0",
"Config::IniFiles": "0",
"CPAN::Testers::Common::DBUtils": "0.03",
"DBI": "0",
"DBD::mysql": "0",
"DBD::SQLite": "1.07",
"Email::Simple": "0",
"File::Basename": "0",
"File::Copy": "0",
"File::Path": "0",
"File::Slurp": "0",
"GD::Graph::lines": "0",
"Getopt::ArgvFile": "0",
"Getopt::Long": "0",
"HTML::Entities": "0",
"HTTP::Request": "0",
"IO::File": "0",
"JSON": "0",
"LWP::UserAgent": "0",
"Sort::Versions": "0",
"Template": "0",
"Time::Piece": "0"
}
},
"test" : {
"requires": {
"Archive::Extract": "0",
"Archive::Zip": "0",
"File::Spec": "0",
"Test::Differences": "0",
"Test::More": "0.70"
},
"recommends": {
"Test::CPAN::Meta": "0.13",
"Test::JSON::Meta": "0.08",
"Test::MockObject": "0",
"Test::Pod": "1.00",
"Test::Pod::Coverage": "0.08"
}
}
},

"provides": {
"CPAN::Testers::WWW::Statistics": {
"file": "lib/CPAN/Testers/WWW/Statistics.pm",
"version": "0.87"
},
"CPAN::Testers::WWW::Statistics::Page": {
"file": "lib/CPAN/Testers/WWW/Statistics/Page.pm",
"version": "0.87"
},
"CPAN::Testers::WWW::Statistics::Graphs": {
"file": "lib/CPAN/Testers/WWW/Statistics/Graphs.pm",
"version": "0.87"
}
},
"no_index": {
"directory": ["t","examples"]
},

"resources": {
"license": "http://dev.perl.org/licenses/",
"bugtracker": { "web": "http://rt.cpan.org/Public/Dist/Display.html?Name=CPAN-Testers-WWW-Statistics" },
"repository": {
"url": "git://github.com/barbie/cpan-testers-www-statistics.git",
"web": "http://github.com/barbie/cpan-testers-www-statistics",
"type": "git"
}
}
}
19 changes: 10 additions & 9 deletions META.yml
@@ -1,11 +1,11 @@
--- #YAML:1.0
name: CPAN::Testers::WWW::Statistics
version: 0.87
abstract: Scripts to create the cpanstats website
abstract: Scripts to create the CPAN Testers Statistics website
author:
- Barbie <barbie@cpan.org>

license: perl
license: artistic_2
distribution_type: module
installdirs: site

Expand All @@ -14,6 +14,7 @@ requires:
Class::Accessor::Fast: 0
Config::IniFiles: 0
CPAN::Testers::Common::DBUtils: 0.03
DBI: 0
DBD::mysql: 0
DBD::SQLite: 0
GD::Graph::lines: 0
Expand All @@ -25,26 +26,26 @@ requires:
Getopt::ArgvFile: 0
Getopt::Long: 0
HTML::Entities: 0
HTTP::Request: 0
IO::File: 0
JSON: 0
LWP::UserAgent: 0
Sort::Versions: 0
Template: 0
Time::Piece: 0
LWP::UserAgent: 0
HTTP::Request: 0
recommends:
Test::CPAN::Meta: 0.13
Test::JSON::Meta: 0.08
Test::More: 0.70
Test::MockObject: 0
Test::Pod: 1.00
Test::Pod::Coverage: 0.08
Test::CPAN::Meta: 0.12
build_requires:
Test::More: 0.01
Test::Differences: 0
Archive::Zip: 0
Archive::Extract: 0
File::Slurp: 0
Archive::Zip: 0
File::Spec: 0
Test::Differences: 0
Test::More: 0.70

provides:
CPAN::Testers::WWW::Statistics:
Expand Down
13 changes: 8 additions & 5 deletions Makefile.PL
Expand Up @@ -8,7 +8,6 @@ WriteMakefile(

Class::Accessor::Fast => 0,
Config::IniFiles => 0,
CPAN::Testers::Common::DBUtils => 0.03,
GD::Graph::lines => 0,
File::Basename => 0,
File::Copy => 0,
Expand All @@ -17,30 +16,34 @@ WriteMakefile(
Getopt::ArgvFile => 0,
Getopt::Long => 0,
HTML::Entities => 0,
HTTP::Request => 0,
IO::File => 0,
JSON => 0,
LWP::UserAgent => 0,
Sort::Versions => 0,
Template => 2.19,
WWW::Mechanize => 0,

# for the CGI tools
CGI => 0,
Email::Simple => 0,
Time::Piece => 0,

# for database access
CPAN::Testers::Common::DBUtils => 0.03,
DBI => 0,
DBD::mysql => 0,
DBD::SQLite => 0,

Test::Differences => 0, # for testing
# for testing
Archive::Zip => 0, # for testing
Archive::Extract => 0, # for testing
File::Slurp => 0, # for testing
File::Spec => 0, # for testing
Test::Differences => 0, # for testing
},

NO_META => 1,

($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT => 'Scripts to create the cpanstats website',
(ABSTRACT => 'Scripts to create the CPAN Testers Statistics website',
AUTHOR => 'Barbie <barbie@cpan.org>') : ()),
);
18 changes: 12 additions & 6 deletions t/56writes.t
Expand Up @@ -4,6 +4,7 @@ use strict;
use warnings;
$|=1;

my $CHECK_DOMAIN = 'www.google.com';

# NOTE about t/56writes.t & t/expected.zip...
#
Expand Down Expand Up @@ -110,7 +111,7 @@ ok( CTWS_Testing::cleanDir($obj), 'directory cleaned' );
# Tests for creating graphs

SKIP: {
skip "Can't see a network connection", 66 if(pingtest());
skip "Can't see a network connection", 66 if(pingtest($CHECK_DOMAIN));

$obj->directory($dir . '/create'),
$page->create();
Expand Down Expand Up @@ -150,7 +151,7 @@ ok( CTWS_Testing::cleanDir($obj), 'directory cleaned' );


SKIP: {
skip "Can't see a network connection", 11 if(pingtest());
skip "Can't see a network connection", 11 if(pingtest($CHECK_DOMAIN));

CTWS_Testing::saveFiles($dir . '/make_graphs');

Expand Down Expand Up @@ -270,8 +271,13 @@ sub check_dir_contents {

# crude, but it'll hopefully do ;)
sub pingtest {
system("ping -q -c 1 www.google.com >/dev/null");
my $retcode = $? >> 8;
# ping returns 1 if unable to connect
return $retcode;
my $domain = shift or return 0;
my $cmd = $^O =~ /solaris/i ? "ping -s $domain 56 1" :
$^O =~ /dos|os2|mswin32|netware|cygwin/i ? "ping -n 1 $domain "
: "ping -c 1 $domain >/dev/null 2>&1";

system($cmd);
my $retcode = $? >> 8;
# ping returns 1 if unable to connect
return $retcode;
}
4 changes: 2 additions & 2 deletions t/94metatest.t
Expand Up @@ -4,8 +4,8 @@ use Test::More;
plan skip_all => "Author tests not required for installation"
unless ( $ENV{AUTOMATED_TESTING} );

eval "use Test::CPAN::Meta 0.12";
plan skip_all => "Test::CPAN::Meta 0.12 required for testing META.yml" if $@;
eval "use Test::CPAN::Meta 0.13";
plan skip_all => "Test::CPAN::Meta 0.13 required for testing META.yml" if $@;

plan no_plan;

Expand Down
25 changes: 25 additions & 0 deletions t/96metatest.t
@@ -0,0 +1,25 @@
use Test::More;

# Skip if doing a regular install
plan skip_all => "Author tests not required for installation"
unless ( $ENV{AUTOMATED_TESTING} );

eval "use Test::JSON::Meta 0.08";
plan skip_all => "Test::JSON::Meta 0.08 required for testing META.json files" if $@;

plan no_plan;

my $meta = meta_spec_ok(undef,undef,@_);

use CPAN::Testers::WWW::Statistics;
my $version = $CPAN::Testers::WWW::Statistics::VERSION;

is($meta->{version},$version,
'META.json distribution version matches');

if($meta->{provides}) {
for my $mod (keys %{$meta->{provides}}) {
is($meta->{provides}{$mod}{version},$version,
"META.json entry [$mod] version matches");
}
}

0 comments on commit e5920ef

Please sign in to comment.