Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (26 sloc) 0.829 kB
name 'p5i';
description 'Support .p5i file';
author 'Tatsuhiko Miyagawa';
api_version 0.1;
hook locate_dist => sub {
my $args = shift;
if ($args->{module} =~ m!\.p5i$!) {
my $content;
if (-e $args->{module}) {
$content = do { open my $fh, "<$args->{module}"; join '', <$fh> };
} elsif ($args->{module} =~ /^(https?|ftp|file):/) {
$args->{app}->chat("Fetching remote p5i $args->{module}\n");
$content = $args->{app}->get($args->{module});
}
return unless $content;
my @lines = split /\r?\n/, $content;
my @dists;
for (@lines) {
s/#.*$//;
next unless /\S/;
next if /^Module::Plan::Lite/;
push @dists, $_;
}
return sub { \@dists };
}
};
Jump to Line
Something went wrong with that request. Please try again.