Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kentnl/cpan-distribution-releasehistory
Show the release history of a single distribution
https://github.com/kentnl/cpan-distribution-releasehistory
perl
Last synced: about 2 months ago
JSON representation
Show the release history of a single distribution
- Host: GitHub
- URL: https://github.com/kentnl/cpan-distribution-releasehistory
- Owner: kentnl
- License: other
- Created: 2014-06-11T11:01:43.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-06T13:51:51.000Z (almost 8 years ago)
- Last Synced: 2023-08-20T22:52:18.162Z (over 1 year ago)
- Topics: perl
- Language: Perl
- Size: 170 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.mkdn
- Changelog: Changes
- Contributing: CONTRIBUTING.pod
- License: LICENSE
Awesome Lists containing this project
README
# NAME
CPAN::Distribution::ReleaseHistory - Show the release history of a single distribution
# VERSION
version 0.002006
# SYNOPSIS
This is similar in concept to `CPAN::ReleaseHistory`, except its tailored to use a single distribution name, and uses
`MetaCPAN` to resolve its information.use CPAN::Distribution::ReleaseHistory;
my $release_history = CPAN::Distribution::ReleaseHistory->new(
distribution => 'Dist-Zilla',
# ua => a HTTP::Tiny instance to use for requests
# es => a Search::Elasticsearch instance
# scroll_size => 1000 : How many results to fetch per HTTP request
# sort => 'desc': Direction of sort ( vs 'asc' and undef )
);# Returns a CPAN::Distribution::ReleaseHistory::ReleaseIterator
my $iterator = $release_history->release_iterator();# $release is an instance of CPAN::Distribution::ReleaseHistory::Release
while ( my $release = $iterator->next_release() ) {
print $release->distname(); # Dist-Zilla
print $release->path(); # R/RJ/RJBS/Dist-Zilla-1.000.tar.gz
print scalar gmtime $release->timestamp(); # Timestamp is Unixtime.
print $release->size(); # 30470 ( bytes )
my $distinfo = $release->distinfo(); # CPAN::DistInfo object
}# METHODS
## `release_iterator`
Perform the query and return a new
[`CPAN::Distribution::ReleaseHistory::ReleaseIterator`](https://metacpan.org/pod/CPAN::Distribution::ReleaseHistory::ReleaseIterator) to walk over
the results.my $iterator = $object->release_iterator
## `has_ua`
Determine if user specified a custom `UserAgent`
# ATTRIBUTES
## `distribution`
A string exactly matching a name of a `CPAN` distribution.
example:
Dist-Zilla
MetaCPAN-Client
Search-Elasticsearch
WWW-Mechanize-Cached## `sort`
The implicit sort direction of the output.
default: 'desc' # The most recent release is returned first.
Alternative options:
'asc' # The oldest release is returned first
undef # Results are unsorted#### `undef`
Opting for `undef` for this value will give a slight speed up to the responsiveness of queries.
Though this benefit will only be observed in conjunction with low values of `scroll_size`
5 desc average 0.08625 /each 11.594 items/sec
5 undef average 0.03856 /each 25.937 items/sec10 desc average 0.05384 /each 18.573 items/sec
10 undef average 0.03773 /each 26.507 items/sec20 desc average 0.03856 /each 25.934 items/sec
20 undef average 0.02758 /each 36.252 items/sec50 desc average 0.02579 /each 38.777 items/sec
50 undef average 0.02547 /each 39.267 items/sec100 desc average 0.02279 /each 43.873 items/sec
100 undef average 0.02510 /each 39.846 items/sec## `scroll_size`
Volume of results to fetch per request.
default: 1000
Larger values give slower responses but faster total execution time.
Smaller values give faster responses but slower total execution time. ( Due to paying ping time both ways per request in
addition to other per-request overheads that are constant sized )## `ua`
A `HTTP::Tiny` compatible user agent.
## `es`
A Search::Elasticsearch instance.
# AUTHOR
Kent Fredric
# COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Kent Fredric .
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.