Cache-Ehcache
view release on metacpan or search on metacpan
inc/Module/Install/Fetch.pm view on Meta::CPAN
require Cwd;
my $dir = Cwd::getcwd();
chdir $args{local_dir} or return if exists $args{local_dir};
if (eval { require LWP::Simple; 1 }) {
LWP::Simple::mirror($args{url}, $file);
}
elsif (eval { require Net::FTP; 1 }) { eval {
# use Net::FTP to get past firewall
my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
$ftp->login("anonymous", 'anonymous@example.com');
$ftp->cwd($path);
$ftp->binary;
$ftp->get($file) or (warn("$!\n"), return);
$ftp->quit;
} }
elsif (my $ftp = $self->can_run('ftp')) { eval {
# no Net::FTP, fallback to ftp.exe
require FileHandle;
my $fh = FileHandle->new;
t/03_keys.t view on Meta::CPAN
use strict;
use warnings;
use Test::More;
use IO::Socket::INET;
use Cache::Ehcache;
my $skip = 1;
my $addr = "127.0.0.1:8080";
my $sock =
IO::Socket::INET->new( PeerAddr => $addr, Proto => 'tcp', Timeout => 3 );
if ($sock) {
$sock->send("GET /ehcache/rest/foo\n\n");
my $buf;
$sock->recv( $buf, 1024 );
$skip = 0 if ($buf);
}
if ($skip) {
plan skip_all => "No Ehcache Server running at $addr\n";
exit 0;
}
( run in 0.233 second using v1.01-cache-2.11-cpan-4d50c553e7e )