WWW::PAUSE::Simple - An API for PAUSE
This document describes version 0.452 of WWW::PAUSE::Simple (from Perl distribution WWW-PAUSE-Simple), released on 2021-08-26.
This module provides several functions for performing common tasks on PAUSE. There is also a CLI script pause distributed separately in App::pause.
delete_files(%args) -> [$status_code, $reason, $payload, \%result_meta]
When a file is deleted, it is not immediately deleted but has scheduled_for_deletion status for 72 hours, then deleted. During that time, the file can be undeleted.
This function is not exported by default, but exportable.
This function supports dry-run operation.
Arguments ('*' denotes required arguments):
files* => array[str]
File names/wildcard patterns.
password => str
If unset, default value will be searched from ~/.pause. Encrypted .pause is not yet supported.
protect_files => array[str]
Protect some files/wildcard patterns from delete/cleanup.
retries => int (default: 5)
Number of retries when received 5xx HTTP error from server.
The retry uses an exponential backoff strategy of delaying 3, 6, 12, 24, ..., 3600, 3600, ... seconds.
username => str
-dry_run => bool
Pass -dry_run=>1 to enable simulation mode.
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code (200 means OK, 4xx caller error, 5xx function error). Second element ($reason) is a string containing error message, or something like "OK" if status is 200. Third element ($payload) is the actual result, but usually not present when enveloped result is an error response ($status_code is not 2xx). Fourth element (%result_meta) is called result metadata and is optional, a hash that contains extra information, much like how HTTP response headers provide additional metadata.
Return value: (any)
delete_old_releases(%args) -> [$status_code, $reason, $payload, \%result_meta]
Delete older versions of distributions.
Currently does not look for releases in subdirectories.
By default does not include developer (trial) releases. To include that, use --include-dev.
To only cleanup developer releases, you can use --include-dev and --exclude-nondev.
detail => bool
Whether to return detailed records.
include_dev => bool (default: 0)
Whether to include cleaning up non-dev releases.
include_nondev => bool (default: 1)
num_keep => int (default: 1)
Number of new versions (including newest) to keep.
1 means to only keep the newest version, 2 means to keep the newest and the second newest, and so on.
list_dists(%args) -> [$status_code, $reason, $payload, \%result_meta]
Distribution names will be extracted from tarball/zip filenames.
Unknown/unparseable filenames will be skipped.
include_dev => bool
newest => bool
Only show newest non-dev version.
Dev versions will be skipped.
newest_n => int
Only show this number of newest versions.
list_files(%args) -> [$status_code, $reason, $payload, \%result_meta]
del => bool
Only list files which are scheduled for deletion.
files => array[str]
mtime_max => date
mtime_min => date
size_max => uint
size_min => uint
list_modules(%args) -> [$status_code, $reason, $payload, \%result_meta]
List modules (permissions).
This function is not exported.
modules => array[str]
Module names/wildcard patterns.
type => str
Only list modules matching certain type.
reindex_files(%args) -> [$status_code, $reason, $payload, \%result_meta]
undelete_files(%args) -> [$status_code, $reason, $payload, \%result_meta]
upload_files(%args) -> [$status_code, $reason, $payload, \%result_meta]
delay => duration
Pause a number of seconds between files.
If you upload a lot of files (e.g. 7-10 or more) at a time, the PAUSE indexer currently might choke with SQLite database locking problem and thus fail to index your releases. Giving a delay of say 2-3 minutes (120-180 seconds) between files will alleviate this problem.
subdir => str (default: "")
Subdirectory to put the file(s) into.
Please visit the project's homepage at https://metacpan.org/release/WWW-PAUSE-Simple.
Source repository is at https://github.com/perlancar/perl-WWW-PAUSE-Simple.
CPAN::Uploader which also does uploading from CLI.
WWW::PAUSE::CleanUpHomeDir which can clean old releases from your PAUSE account (CLI script is provided in example).
App::PAUSE::cleanup which also cleans old releases from your PAUSE account, with CLI included pause-cleanup.
To contribute, you can send patches by email/via RT, or send pull requests on GitHub.
Most of the time, you don't need to build the distribution yourself. You can simply modify the code, then test via:
% prove -l
If you want to build the distribution (e.g. to try to install it locally on your system), you can install Dist::Zilla, Dist::Zilla::PluginBundle::Author::PERLANCAR, and sometimes one or two other Dist::Zilla plugin and/or Pod::Weaver::Plugin. Any additional steps required beyond that are considered a bug and can be reported to me.
This software is copyright (c) 2021, 2020, 2019, 2018, 2017, 2016, 2015 by perlancar <firstname.lastname@example.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=WWW-PAUSE-Simple
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
To install WWW::PAUSE::Simple, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.