Created
September 17, 2010 10:21
-
-
Save draegtun/584025 to your computer and use it in GitHub Desktop.
Get perl version releases using its git tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.012; | |
use warnings; | |
use Net::GitHub::V2::Repositories; | |
my $github = Net::GitHub::V2::Repositories->new( | |
owner => 'mirrors', repo => 'perl', | |
); | |
my @versions; | |
my $tags = $github->tags; | |
for my $tag (keys %$tags) { | |
# just perl5 since 5.6 | |
if ($tag =~ m/^(perl-|v)5\.(\d+)\.(\d+)(.*)/) { | |
push @versions, [5, $2, $3, $4]; | |
} | |
} | |
sub by_version { | |
$b->[0] <=> $a->[0] || | |
$b->[1] <=> $a->[1] || | |
$b->[2] <=> $a->[2]; | |
} | |
sub format_version { sprintf "perl-%d.%d.%d%s", @_ } | |
# print versions from latest to oldest | |
for my $version (sort by_version @versions) { | |
next if $version->[3] =~ m/RC/; # <= exclude release candidates | |
next if $version->[1] % 2 != 0; # <= exclude development versions | |
say format_version( @$version ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment