CPAN-Mini-Live
view release on metacpan or search on metacpan
lib/CPAN/Mini/Live.pm view on Meta::CPAN
request => '/feed/minicpan',
on_entry => sub {
my $entry = shift;
my $body = $entry->{body};
my ($action) = $body =~ /^(.+?) /;
my ($uri) = $body =~ /href="(.+?)"/;
my $path = $uri;
my $remote = $self->{remote};
$path =~ s/^$remote//;
my $local_file
= File::Spec->catfile( $self->{local}, split m{/}, $path );
$self->trace("live [$action] [$path]\n");
if ( $action eq 'mirror_file' ) {
$self->mirror_file($path);
} elsif ( $action eq 'clean_file' ) {
$self->clean_file($local_file);
} else {
warn "ERROR: unknown action $action";
$done->send;
}
lib/CPAN/Mini/Live/Publish.pm view on Meta::CPAN
my ( $self, $path, $skip_if_present, $arg ) = @_;
my $remote_uri
= eval { $path->isa('URI') }
? $path
: URI->new_abs( $path, $self->{remote} )->as_string;
my $local_file
= File::Spec->catfile(
$arg->{to_scratch} ? $self->{scratch} : $self->{local},
split m{/}, $path );
my $file_exists = -f $local_file;
my ( $contents, $atime, $mtime );
if ($file_exists) {
( $atime, $mtime ) = ( stat $local_file )[ 8, 9 ];
$contents = read_file($local_file);
}
my $return = $self->SUPER::mirror_file( $path, $skip_if_present, $arg );
$skip_if_present ||= 0;
( run in 0.326 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )