Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

JPerl Advent Calendar 2009 (casual) 22th day example

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 example
Octocat-spinner-32 lib
Octocat-spinner-32 t
Octocat-spinner-32 Changes
Octocat-spinner-32 MANIFEST
Octocat-spinner-32 Makefile.PL
Octocat-spinner-32 README
README
BackPAN::Downloader version 0.01
========================

an installer of BackPAN modules

INSTALLATION

To install this module type the following:

   perl Makefile.PL
   make
   make test
   make install

SYNOPSYS
        use strict;
        use BackPAN::Downloader;

        my $backpan  = BackPAN::Downloader->new( temp_dir => './tmp' );
        my $distname = 'NOT::IN::CPAN::MODULE';

        $backpan->lookup( $distname ) or die $backpan->error;
        $backpan->download() or die sprintf("Can't download. (%s)", $backpan->error);
        $backpan->install()  or die "Can't install, " . $backpan->error;

DESCRIPTION
    This is a BackPAN module installer.

METHODS
  new
        $backpan = BackPAN::Downloader->new;

    Creates a new object. It can take an named option:

    temp_dir
        A directory for saving downloaded file.

  lookup
        $backpan->lookup( $distribution );

    Check a distribution. If the distribution is found, returns
    Parse::BACKPAN::Packages::Distribution. Otherwise "undef".

    The found Parse::BACKPAN::Packages::Distribution and
    Parse::BACKPAN::Packages::File object are set into "distfile" and
    "filedata".

  download
    Downloads the lookuped distribution file.

  install
        $backpan->install();

    Installs the downloaded distribution file. If set "delete_saved_file"
    option, it will delete the downloaded file after install.

        $backpan->install( delete_saved_file => 1 );

    This method returns false if an explicit error is raised. But a return
    of a true vaule does not mean that the installation was sucessful.

  reset
    Resets a found distribution data.

  temp_dir
        $backpan->temp_dir( $dir );
        $dir = $backpan->temp_dir();

    A directory for saving downloaded file.

  dist_is_found
        $bool = $backpan->dist_is_found;

    Returns the result of "lookup" method.

  ua
    Returns a LWP::UserAgent object getting "backpan.txt.gz".

  error
    Returns an error message.

  distfile
    Returns a found Parse::BACKPAN::Packages::Distribution.

  filedata
    Returns a found Parse::BACKPAN::Packages::File.

AUTHOR
    Makamaka Hannyaharamitu, <makamaka[at]cpan.org>

COPYRIGHT AND LICENSE
    Copyright 2009 by Makamaka Hannyaharamitu, <makamaka[at]cpan.org>

    This library is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

SEE ALSO
    Parse::BACKPAN::Packages, CPAN::Inject, CPAN::Shell, LWP::UserAgent

Something went wrong with that request. Please try again.