diff --git a/Changes b/Changes index 6d2ec20..88b3696 100644 --- a/Changes +++ b/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. diff --git a/MANIFEST b/MANIFEST index 9f8ef10..3781472 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2,6 +2,7 @@ Changes data/01mailrc.txt Makefile.PL MANIFEST +META.json META.yml README bin/addresses.pl @@ -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 diff --git a/META.json b/META.json new file mode 100644 index 0000000..4bc391a --- /dev/null +++ b/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) " + ], + + "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" + } + } +} \ No newline at end of file diff --git a/META.yml b/META.yml index 36d6640..1bf2db2 100644 --- a/META.yml +++ b/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 -license: perl +license: artistic_2 distribution_type: module installdirs: site @@ -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 @@ -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: diff --git a/Makefile.PL b/Makefile.PL index c9683d9..0175d6d 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -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, @@ -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 ') : ()), ); diff --git a/t/56writes.t b/t/56writes.t index 6e102b5..b7d8b55 100644 --- a/t/56writes.t +++ b/t/56writes.t @@ -4,6 +4,7 @@ use strict; use warnings; $|=1; +my $CHECK_DOMAIN = 'www.google.com'; # NOTE about t/56writes.t & t/expected.zip... # @@ -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(); @@ -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'); @@ -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; } diff --git a/t/94metatest.t b/t/94metatest.t index 210cbc7..c5efe83 100644 --- a/t/94metatest.t +++ b/t/94metatest.t @@ -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; diff --git a/t/96metatest.t b/t/96metatest.t new file mode 100644 index 0000000..6f546c1 --- /dev/null +++ b/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"); + } +}