CPAN::Local::Distribution::Role::FromURI - Allow distributions to be fetched from remote uris
version 0.007
This role allows a distribution object to be created from a remote URI rather than from a local file. The URI will be fetched and saved locally, and "filename" in CPAN::Local::Distribution will be set to the local file's name.
package CPAN::Local::Distribution::Custom { use Moose; extends 'CPAN::Local::Distribution'; with 'CPAN::Local::Distribution::Role::FromURI'; } package main { my $distro = CPAN::Local::Distribution::Custom->new( uri => 'http:://www.somepan.org/authors/id/F/FO/FOOBAR/Foo-Bar-0.001.tar.gz', cache => '/path/to/cache' ); say $distro->filename; # /path/to/cache/authors/id/F/FO/FOOBAR/Foo-Bar-0.001.tar.gz say $distro->authorid; # FOOBAR }
The remote distribution URI. The last part of the path must be a valid distribution name.
Directory where the distribution will be downloaded to. A temporarary directory will be used if none is specified. If the distribution already exists in the cache, it will not be downloaded again.
Peter Shangov <pshangov@yahoo.com>
This software is copyright (c) 2012 by Venda, Inc..
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install CPAN::Local, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CPAN::Local
CPAN shell
perl -MCPAN -e shell install CPAN::Local
For more information on module installation, please visit the detailed CPAN module installation guide.