root/lang/perl/Acme-JapaneseCPANAuthors/trunk/lib/Acme/JapaneseCPANAuthors/Utils.pm

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 
1package Acme::JapaneseCPANAuthors::Utils;
2
3use strict;
4use warnings;
5use base qw( Exporter );
6use File::Spec;
7
8our @EXPORT = qw( _package_file _author_file );
9
10sub _author_file {
11  _cpan_file( authors => '01mailrc.txt.gz' );
12}
13
14sub _package_file {
15  _cpan_file( modules => '02packages.details.txt.gz' );
16}
17
18sub _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
32sub _catfile { File::Spec->canonpath( File::Spec->catfile( @_ ) ); }
33
341;
35
36__END__
37
38=head1 NAME
39
40Acme::JapaneseCPANAuthors::Utils
41
42=head1 DESCRIPTION
43
44This is used internally, and exports several internal utility functions.
45
46=head1 AUTHOR
47
48Kenichi Ishigaki, E<lt>ishigaki at cpan.orgE<gt>
49
50=head1 COPYRIGHT AND LICENSE
51
52Copyright (C) 2007 by Kenichi Ishigaki.
53
54This program is free software; you can redistribute it and/or
55modify it under the same terms as Perl itself.
56
57=cut
Note: See TracBrowser for help on using the browser.