Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 40 lines (34 sloc) 796 Bytes
#!/usr/bin/env perl
use strict;
use warnings;
use Cwd qw(realpath);
use File::Basename;
my $BASE_DIR = dirname realpath __FILE__;
use Data::Dumper;
$Data::Dumper::Indent = 1;
$Data::Dumper::Terse = 1;
$Data::Dumper::Sortkeys = 1;
my $users = {};
{
open my $fh, '<', $BASE_DIR . '/authors';
while (<$fh>) {
s/\s*(?:#.*)?$//;
s/^\s+//;
next
if $_ eq '';
if ( /(\w+)\s*=\s*(.*?)\s*<([^>]+)>/ ) {
my ($user, $name, $email) = ($1, $2, $3);
$users->{$user} = {
user => $user,
name => $name,
email => $email,
};
}
}
close $fh;
}
{
open my $fh, '>', "$BASE_DIR/cache/author-data.pl";
print { $fh } Dumper($users);
close $fh;
}