X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FAcme-CPANAuthors-You-re_using.git;a=blobdiff_plain;f=lib%2FAcme%2FCPANAuthors%2FYou%2Fre_using.pm;h=42c52936a545184b7ffa90682a8c181e9cd5c120;hp=785b614d0b89e6bea334e0ec39c90205086c3f8f;hb=b3a0b1bbf279a40842b7244e25d8b9e951a82f90;hpb=41c2781606f5304bf1edaae54a0b892250bf0679 diff --git a/lib/Acme/CPANAuthors/You/re_using.pm b/lib/Acme/CPANAuthors/You/re_using.pm index 785b614..42c5293 100644 --- a/lib/Acme/CPANAuthors/You/re_using.pm +++ b/lib/Acme/CPANAuthors/You/re_using.pm @@ -15,13 +15,13 @@ Acme::CPANAuthors::You::re_using - We are the CPAN authors that have written the =head1 VERSION -Version 0.01 +Version 0.03 =cut our $VERSION; BEGIN { - $VERSION = '0.01'; + $VERSION = '0.03'; } =head1 SYNOPSIS @@ -35,11 +35,24 @@ BEGIN { This module builds an L class by listing all the modules that are installed on the current C and then retrieving the name and the PAUSE id of their corresponding authors. -It may take some time to load since it has to get CPAN indexes at C time. +It may take some time to load since it has to search all the directory trees given by your C<@INC> for modules, but also to get and parse CPAN indexes. + +=head1 FUNCTIONS + +=head2 C + +Fetches and registers the names into L. +This function is automatically called when you C this module, unless you have set the package variable C<$Acme::CPANAuthors::You're_using::SKIP> to true beforehand. =cut -BEGIN { +BEGIN { require Acme::CPANAuthors::Register; } + +our $SKIP; + +sub register { + return if $SKIP; + my %authors; my $pkgs = Acme::CPANAuthors::Utils::cpan_packages(); @@ -48,7 +61,7 @@ BEGIN { my $auths = Acme::CPANAuthors::Utils::cpan_authors(); croak 'Couldn\'t retrieve a valid Parse::CPAN::Authors object' unless $auths; - my $installed = ExtUtils::Installed->new(extra_libs => \@INC); + my $installed = ExtUtils::Installed->new(); croak 'Couldn\'t create a valid ExtUtils::Installed object' unless $installed; for ($installed->modules) { @@ -71,10 +84,11 @@ BEGIN { $authors{$cpanid} = defined $name ? $name : $cpanid; } - require Acme::CPANAuthors::Register; Acme::CPANAuthors::Register->import(%authors); } +BEGIN { register() } + =head1 DEPENDENCIES L, L, L. @@ -101,7 +115,7 @@ You can find documentation for this module with the perldoc command. =head1 COPYRIGHT & LICENSE -Copyright 2009 Vincent Pit, all rights reserved. +Copyright 2009,2010,2011 Vincent Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.