Acme-CPANAuthors
view release on metacpan or search on metacpan
- fixed example in ::Utils (ETHER)
- not to require packages if ->author is available
0.21 2013/05/31
- new author lists added (ETHER)
- avatar_url falls back to <id>@cpan.org when no match is found from
the email address (ETHER)
- warning is issued when trying to fetch a gravatar when Gravatar::URL is
not installed; Gravatar::URL added to recommended prereqs (ETHER)
- id() now always assumes list context for the caller (ETHER)
- added repository information to metadata
0.20 2012/11/01
- listed new module: Czech
- various pod fixes
- Gravatar::URL is now optional
0.19 2012/03/10
- no redefine warning
- listed new module: Catalonian
0.12 2010/09/25
- added ToBeLike to the list.
- bundled Parse::CPAN::* alternatives to cut off antlers.
0.11 2010/09/20
- oops, forgot to update dependencies
0.10 2010/09/20
- use Try::Tiny for better trapping
- added several modules to the subordinate modules list
- launched a new api server to fetch kwalitee data as json.
no need to scrape kwalitee pages anymore
0.09 2009/08/23
- added Arabic and German to the subordinate modules list,
and rearranged the list a bit.
- added a reason why I wrote this
- added a tentative workaround to t/03_extra.t. hope this works...
0.08 2009/04/21
- added more lists to the pod
t/02_standalone.t
t/03_extra.t
t/04_lookfor.t
t/05_kwalitee.t
t/06_parse_mailrc.t
t/07_parse_packages.t
t/08_inline_package.t
t/09_factory.t
t/99_pod.t
t/99_podcoverage.t
t/data/authors/01mailrc.txt
t/data/authors/01mailrc.txt.gz
t/data/modules/02packages.details.txt
t/data/modules/02packages.details.txt.gz
t/lib/Acme/CPANAuthors/Test.pm
t/lib/Acme/CPANAuthors/TestExtra.pm
META.yml Module YAML meta-data (added by MakeMaker)
META.json Module JSON meta-data (added by MakeMaker)
lib/Acme/CPANAuthors/Factory.pm view on Meta::CPAN
package Acme::CPANAuthors::Factory;
use strict;
use warnings;
use Acme::CPANAuthors;
sub create {
my ($class, %data) = @_;
my @categories = keys %data;
my %authors = map { %{ $data{$_} } } @categories;
return bless {
categories => \@categories,
authors => \%authors,
}, 'Acme::CPANAuthors';
}
1;
__END__
lib/Acme/CPANAuthors/Factory.pm view on Meta::CPAN
my $number = $authors->count;
# and all other methods described in Acme::CPANAuthors...
=head1 DESCRIPTION
Use this class when you have a list of authors that you want to manipulate,
but you only have the list of names at runtime (where
L<Acme::CPANAuthors::Register> is not very convenient).
An L<Acme::CPANAuthors> object will be created for you, containing the same
data as if you had registered a new class at compile time.
However, you cannot call C<< Acme::CPANAuthors->new >> with your category and
get back a new object; it still only knows about modules on disk.
=head1 METHOD
=head2 create
takes a hash reference to create an Acme::CPANAuthors object.
lib/Acme/CPANAuthors/Utils/Authors.pm view on Meta::CPAN
my $authors = Acme::CPANAuthors::Utils::Authors->new(
'cpan/authors/01mailrc.txt.gz'
);
my $author = $authors->author('ISHIGAKI');
=head1 DESCRIPTION
This is a subset of L<Parse::CPAN::Authors>. The reading
methods are similar in general (accessors are marked as
read-only, though). Internals and data-parsing methods may
be different, but you usually don't need to care.
=head1 METHODS
=head2 new
always takes a file name (both raw C<.txt> file and C<.txt.gz>
file name are acceptable). Raw content of the file is not
acceptable.
lib/Acme/CPANAuthors/Utils/Packages.pm view on Meta::CPAN
my $package = $packages->package('Acme::CPANAuthors');
my $dist = $packages->distribution('I/IS/ISHIGAKI/Acme-CPANAuthors-0.12.tar.gz');
my $latest = $packages->latest_distribution('Acme-CPANAuthors');
=head1 DESCRIPTION
This is a subset of L<Parse::CPAN::Packages>. The reading
methods are similar in general (accessors are marked as
read-only, though). Internals and data-parsing methods may
be different, but you usually don't need to care.
=head1 METHODS
=head2 new
always takes a file name (both raw C<.txt> file and C<.txt.gz>
file name are acceptable). Raw content of the file is not
acceptable.
t/03_extra.t view on Meta::CPAN
use Test::More;
use Acme::CPANAuthors;
BEGIN {
eval {require Gravatar::URL; 1} or
plan skip_all => "this test requires Gravatar::URL";
}
plan tests => 1;
local $ENV{ACME_CPANAUTHORS_HOME} = 't/data';
my $authors = Acme::CPANAuthors->new('TestExtra');
my $avatar_url = $authors->avatar_url('AADLER');
ok $avatar_url;
t/06_parse_mailrc.t view on Meta::CPAN
# this test is ripped from Parse::CPAN::Authors
use strict;
use warnings;
#use lib 'lib';
#use IO::Zlib;
#use Test::Exception;
use Test::More tests => 23;
use_ok('Acme::CPANAuthors::Utils::Authors');
my $filename = "t/data/authors/01mailrc.txt";
my $gzfilename = "t/data/authors/01mailrc.txt.gz";
#my $fh = IO::Zlib->new( $gzfilename, "rb" )
# || die "Failed to read $filename: $!";
#my $contents = join '', <$fh>;
#$fh->close;
# try with no filename - not supported
#chdir "t";
#my $p = Acme::CPANAuthors::Utils::Authors->new();
#is_fine($p);
t/07_parse_packages.t view on Meta::CPAN
# this test is ripped from Parse::CPAN::Packages
use strict;
use warnings;
use Test::More tests => 34;
use_ok("Acme::CPANAuthors::Utils::Packages");
my $p = Acme::CPANAuthors::Utils::Packages->new("t/data/modules/02packages.details.txt");
isa_ok( $p, "Acme::CPANAuthors::Utils::Packages" );
my @packages = sort map { $_->package } $p->packages;
is_deeply(
\@packages,
[ qw(Acme::Colour Acme::Colour::Old Acme::ComeFrom Acme::Comment Acme::CramCode Acme::Currency accessors accessors::chained accessors::classic )
]
);
is( $p->file, '02packages.details.txt', 'file' );
t/07_parse_packages.t view on Meta::CPAN
'S/SP/SPURKIS/accessors-0.02.tar.gz',
'X/XE/XERN/Acme-CramCode-0.01.tar.gz',
]
);
# counts
is( $p->package_count(), scalar @packages, "package count" );
is( $p->distribution_count(), 7, "dist count" );
is( $p->latest_distribution_count(), 6, "latest dist count" );
#open( IN, "t/data/modules/02packages.details.txt" );
#my $details = join '', <IN>;
#close(IN);
# Try the interface which takes in the contents
#$p = Acme::CPANAuthors::Utils::Packages->new($details);
#isa_ok( $p, "Acme::CPANAuthors::Utils::Packages" );
#
#@packages = sort map { $_->package } $p->packages;
#is_deeply(
# \@packages,
# [ qw(Acme::Colour Acme::Colour::Old Acme::ComeFrom Acme::Comment Acme::CramCode Acme::Currency accessors accessors::chained accessors::classic )
# ]
#);
# Try the interface which takes in a .gz
$p = Acme::CPANAuthors::Utils::Packages->new("t/data/modules/02packages.details.txt.gz");
isa_ok( $p, "Acme::CPANAuthors::Utils::Packages" );
@packages = sort map { $_->package } $p->packages;
is_deeply(
\@packages,
[ qw(Acme::Colour Acme::Colour::Old Acme::ComeFrom Acme::Comment Acme::CramCode Acme::Currency accessors accessors::chained accessors::classic )
]
);
# Try the interface which takes in gzipped contents - not supported
#
#open( IN, "t/data/modules/02packages.details.txt.gz" );
#$details = join '', <IN>;
#close(IN);
#
#$p = Acme::CPANAuthors::Utils::Packages->new($details);
#isa_ok( $p, "Acme::CPANAuthors::Utils::Packages" );
#
#@packages = sort map { $_->package } $p->packages;
#is_deeply(
# \@packages,
# [ qw(Acme::Colour Acme::Colour::Old Acme::ComeFrom Acme::Comment Acme::CramCode Acme::Currency accessors accessors::chained accessors::classic )
( run in 0.265 second using v1.01-cache-2.11-cpan-8d75d55dd25 )