Alien-Selenium
view release on metacpan or search on metacpan
inc/File/Fetch.pm view on Meta::CPAN
push(@$cmd, '--silent') unless $DEBUG;
### curl does the right thing with passive, regardless ###
if ($self->scheme eq 'ftp') {
push(@$cmd, '--user', "anonymous:$FROM_EMAIL");
}
push @$cmd, '--fail', '--output', $to, $self->uri;
my $captured;
unless(run( command => $cmd,
buffer => \$captured,
verbose => $DEBUG )
) {
warn "command failed: $captured";
return;
}
return $to;
} else {
$METHOD_FAIL->{'curl'} = 1;
return;
}
}
### use File::Copy for fetching file:// urls ###
### XXX file:// uri to local path conversion is just too weird...
### depend on LWP to do it for us
# sub _file_fetch {
# my $self = shift;
# my %hash = @_;
#
# my ($to);
# my $tmpl = {
# to => { required => 1, store => \$to }
# };
# check( $tmpl, \%hash ) or return;
#
# my $remote = File::Spec->catfile( $self->path, $self->file );
#
# ### File::Copy is littered with 'die' statements :( ###
# my $rv = eval { File::Copy::copy( $remote, $to ) };
#
# ### something went wrong ###
# if( !$rv or $@ ) {
# warn "Could not copy '$remote' to '$to': $! $@";
# return;
# }
#
# return $to;
# }
1;
#line 778
# Local variables:
# c-indentation-style: bsd
# c-basic-offset: 4
# indent-tabs-mode: nil
# End:
# vim: expandtab shiftwidth=4:
( run in 0.710 second using v1.01-cache-2.11-cpan-9bca49b1385 )