|
Revision 1065, 1.1 kB
(checked in by charsbar, 14 months ago)
|
|
lang/perl/Acme-JapaneseCPANAuthors: switched to use Parse::CPAN::Authors/Packages and Gravatar::URL
|
| Line | |
|---|
| 1 | package Acme::JapaneseCPANAuthors::Utils;
|
|---|
| 2 |
|
|---|
| 3 | use strict;
|
|---|
| 4 | use warnings;
|
|---|
| 5 | use base qw( Exporter );
|
|---|
| 6 | use File::Spec;
|
|---|
| 7 |
|
|---|
| 8 | our @EXPORT = qw( _package_file _author_file );
|
|---|
| 9 |
|
|---|
| 10 | sub _author_file {
|
|---|
| 11 | _cpan_file( authors => '01mailrc.txt.gz' );
|
|---|
| 12 | }
|
|---|
| 13 |
|
|---|
| 14 | sub _package_file {
|
|---|
| 15 | _cpan_file( modules => '02packages.details.txt.gz' );
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | sub _cpan_file {
|
|---|
| 19 | my ($dir, $basename) = @_;
|
|---|
| 20 |
|
|---|
| 21 | require CPAN::Config;
|
|---|
| 22 | my $source_dir = $CPAN::Config->{keep_source_where};
|
|---|
| 23 | my $file = _catfile( $source_dir, '/', $basename );
|
|---|
| 24 | unless ( -f $file ) {
|
|---|
| 25 | $file = _catfile( $source_dir, '/', $dir, '/', $basename );
|
|---|
| 26 | }
|
|---|
| 27 | die "$file not found" unless -f $file;
|
|---|
| 28 |
|
|---|
| 29 | return $file;
|
|---|
| 30 | }
|
|---|
| 31 |
|
|---|
| 32 | sub _catfile { File::Spec->canonpath( File::Spec->catfile( @_ ) ); }
|
|---|
| 33 |
|
|---|
| 34 | 1;
|
|---|
| 35 |
|
|---|
| 36 | __END__
|
|---|
| 37 |
|
|---|
| 38 | =head1 NAME
|
|---|
| 39 |
|
|---|
| 40 | Acme::JapaneseCPANAuthors::Utils
|
|---|
| 41 |
|
|---|
| 42 | =head1 DESCRIPTION
|
|---|
| 43 |
|
|---|
| 44 | This is used internally, and exports several internal utility functions.
|
|---|
| 45 |
|
|---|
| 46 | =head1 AUTHOR
|
|---|
| 47 |
|
|---|
| 48 | Kenichi Ishigaki, E<lt>ishigaki at cpan.orgE<gt>
|
|---|
| 49 |
|
|---|
| 50 | =head1 COPYRIGHT AND LICENSE
|
|---|
| 51 |
|
|---|
| 52 | Copyright (C) 2007 by Kenichi Ishigaki.
|
|---|
| 53 |
|
|---|
| 54 | This program is free software; you can redistribute it and/or
|
|---|
| 55 | modify it under the same terms as Perl itself.
|
|---|
| 56 |
|
|---|
| 57 | =cut
|
|---|