CGI-Lingua

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

    MIN_PERL_VERSION	=> '5.6.2'	# Probably would work, but never tested on earlier versions than this
);

sub are_online
{
	return 0 if($ENV{'NO_NETWORK_TESTING'} || $ENV{'CIRCLECI'} || $ENV{'TRAVIS_PERL_VERSION'} || $ENV{'AUTOMATED_TESTING'} || $ENV{'NONINTERACTIVE_TESTING'} || (!-t STDIN));

	if(my $s = IO::Socket::INET->new(
		# PeerAddr => 'www.ripe.net:43',
		PeerAddr => 'whois.apnic.net:43',
		Timeout => 5
	)) {
		if($ENV{'PERL_MM_USE_DEFAULT'}) {
			close($s);
			return 1;
		}

		# FIXME: should test if any of the modules has been installed
		if((-r '/usr/local/share/GeoIP/GeoIP.dat') ||
		   (-r '/usr/share/GeoIP/GeoIP.dat')) {
			print <<EOF;

Makefile.PL  view on Meta::CPAN

			print <<EOF;

You appear to be directly connected to the Internet.  I have some tests
that try to query Whois servers.
These tests will be slow, consider installing either IP::Country or Geo::IPfree.

EOF
		}
		close($s);

		# Timeout inspired by Mail::IMAPClient
		my $rc;
		eval {
			local $SIG{ALRM} = sub { die 'alarm' };
			alarm(60);
			$rc = prompt('Do you want to enable these tests?', 'y') =~ /^y/i ? 1 : 0;
			alarm(0);
		};
		if($@) {
			print "\n";
			return 1;	# The default is 'y'

t/noopentickets.t  view on Meta::CPAN

			skip('JSON::MaybeXS required to check for open tickets', 1);
		} else {
			eval 'use IO::Socket::INET';
			if($@) {
				diag('IO::Socket::INET required to check for open tickets');
				skip('IO::Socket::INET required to check for open tickets', 1);
			} else {
				my $s = IO::Socket::INET->new(
					PeerAddr => SITE,
					PeerPort => 'http(80)',
					Timeout => 5
				);
				if($s) {
					eval 'use LWP::Simple';

					if($@) {
						diag('LWP::Simple required to check for open tickets');
						skip('LWP::Simple required to check for open tickets', 1);
					} elsif(my $data = LWP::Simple::get(URL)) {
						my $json = JSON::MaybeXS->new()->utf8();
						my @issues = @{$json->decode($data)};



( run in 0.541 second using v1.01-cache-2.11-cpan-4d50c553e7e )