The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Meta::Lang::Perl::Upload - automatically upload a module to cpan.

COPYRIGHT

Copyright (C) 2001, 2002 Mark Veltzer; All rights reserved.

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.

DETAILS

        MANIFEST: Upload.pm
        PROJECT: meta
        VERSION: 0.08

SYNOPSIS

        package foo;
        use Meta::Lang::Perl::Upload qw();
        my($uploader)=Meta::Lang::Perl::Upload->new();
        $uploader->set_do_ftp(1);
        $uploader->set_do_http(1);
        $uploader->fast_upload("my_first_package.xml);

DESCRIPTION

Give this module the information it needs and it will upload a module to cpan for you. The information that you need to supply is a XML/PERLPKG type file describing your package. Please refer to the XML/PERLPKG DTD and it's documentation to check out how to fill this XML file out. This XML file contains your user id on CPAN, your CPAN password and the name of the package file that needs to be uploaded amongs other things.

How do you use the module ? Create an object of this type, call it's init modules, then call it's upload methos for each package XML file and at the end call the finish method.

How does it do it ? The process is composed of two issues: FTPing the file to the CPAN ftp server and notifying (via HTTP just like the regular user does it with his browser) the PAUSE engine of the new file and to which person it belongs. The first task is accoplished by using Net::FTP and the second using LWP::UserAgent.

The module is object oriented so you can have as many upload objects as you want working in parallel...:)

The idea behind this module is that you could automate your release process by putting a very small script (the package that you got this in should already supply you with such a script) which you can use at the end of your development cycle to automagically upload the end product to CPAN (instead of all the manual clicking and web browsing).

FUNCTIONS

        BEGIN()
        new($)
        init($)
        upload($$)
        finish($)
        ftp_init($)
        ftp_upload($$$)
        ftp_finish($)
        http_init($)
        http_upload($$$)
        http_finish($)
        TEST($)

FUNCTION DOCUMENTATION

BEGIN()

Setup some accessor methods for this class. Attributes are:

new($)

This is a constructor for the Meta::Lang::Perl::Upload object. This method does internal house keeping.

init($)

Initialize the upload process (this includes access to the internet and making the relevant persistant connections).

upload($$)

This method does the actual uploading based on the HTTP protocol. The method receives an uploader object and an XML/PERLPKG file with a description of the package. The method proceeds to calculate where the output package should be, and then uploads the package.

fast_upload($$)

This method is a wrapper method to do init, upload and finish for you.

finish($)

This declares you are finished with the object. FTP and HTTP connections are closed and you can no longer use the upload method. Please call this method and don't just leave the connections dangling.

ftp_init($)

Internal method. Inits the FTP process by opening a binary mode FTP connection to the CPAN FTP server.

ftp_upload($$$)

Internal method. Receives a file. The method does the actual ftping.

ftp_finish($)

Internal method. Shuts down the FTP part of the upload process by terminating the FTP connection.

http_init($)

Internal method. This method initializes the HTTP part of the process. Currently does nothing and the actual work is being done in http_upload.

http_upload($$$)

Internal method. This method receives a file and uses the HTTP agent in Perl to notify the PAUSE of the new file. This method needs your valid CPAN user id and password.

http_finish($)

Internal method. This method terminates the HTTP part of the process. Currently this method does nothing since all of the work is done in http_upload.

TEST($)

Test suite for this module.

SUPER CLASSES

Meta::Development::Verbose(3)

BUGS

None.

AUTHOR

        Name: Mark Veltzer
        Email: mailto:veltzer@cpan.org
        WWW: http://www.veltzer.org
        CPAN id: VELTZER

HISTORY

        0.00 MV web site development
        0.01 MV web site automation
        0.02 MV SEE ALSO section fix
        0.03 MV put all tests in modules
        0.04 MV move tests to modules
        0.05 MV bring movie data
        0.06 MV weblog issues
        0.07 MV teachers project
        0.08 MV md5 issues

SEE ALSO

File::Basename(3), HTTP::Request::Common(3), LWP::UserAgent(3), Meta::Class::MethodMaker(3), Meta::Development::Verbose(3), Meta::Lang::Perl::Perlpkgs(3), Net::FTP(3), strict(3)

TODO

-add option for this module to update the pause engine with a new homepage, new email address and all the other preferences that they have.