Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

imported from version 0.04, see Changes file.

  • Loading branch information...
commit b22caacab6e2305ebee54705563f541f8131ff28 1 parent 8f2f93c
@barbie authored
View
3  Changes
@@ -1,5 +1,8 @@
Revision history for Acme-CPANAuthors-British
+0.04 04/11/2010
+ - fixed skip count and updated pingtest for 11companies.t.
+
0.03 31/10/2010
- revised pingtest.
- added CJK, CYCLES, SKX and XEONTIME as British authors.
View
2  META.yml
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Acme-CPANAuthors-British
-version: 0.03
+version: 0.04
abstract: We are British CPAN authors
author:
- Barbie <barbie@cpan.org>
View
2  lib/Acme/CPANAuthors/British.pm
@@ -4,7 +4,7 @@ use warnings;
{
no strict "vars";
- $VERSION = "0.03";
+ $VERSION = "0.04";
}
use Acme::CPANAuthors::Register (
View
2  lib/Acme/CPANAuthors/British/Companies.pm
@@ -4,7 +4,7 @@ use warnings;
{
no strict "vars";
- $VERSION = "0.03";
+ $VERSION = "0.04";
}
use Acme::CPANAuthors::Register (
View
17 t/11companies.t
@@ -19,7 +19,7 @@ cmp_ok( ~~@ids, ">", 0, " .. \$authors->id gives a non-empty list" );
is( ~~@ids, $number, " .. \$authors->id equals \$authors->count" );
SKIP: {
- skip "CPAN configuration not available", 6
+ skip "CPAN configuration not available", 5
unless eval "Acme::CPANAuthors::Utils::_cpan_authors_file() ; 1";
my @distros = $authors->distributions('FOTANGO');
@@ -45,8 +45,17 @@ SKIP: {
}
sub pingtest {
- my $domain = shift || return 1;
- system("ping -q -c 1 $domain >/dev/null 2>&1");
- my $retcode = $? >> 8;
+ 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";
+
+ eval { system($cmd) };
+ if($@) { # can't find ping, or wrong arguments?
+ diag();
+ return 1;
+ }
+
+ my $retcode = $? >> 8; # ping returns 1 if unable to connect
return $retcode;
}
Please sign in to comment.
Something went wrong with that request. Please try again.