[Bps-public-commit] r9775 - bpsbuilder/BPB/lib/BPB/Source

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sat Dec 1 10:06:10 EST 2007


Author: sunnavy
Date: Sat Dec  1 10:06:10 2007
New Revision: 9775

Added:
   bpsbuilder/BPB/lib/BPB/Source/CPAN.pm

Log:
added cpan support

Added: bpsbuilder/BPB/lib/BPB/Source/CPAN.pm
==============================================================================
--- (empty file)
+++ bpsbuilder/BPB/lib/BPB/Source/CPAN.pm	Sat Dec  1 10:06:10 2007
@@ -0,0 +1,80 @@
+package BPB::Source::CPAN;
+
+use warnings;
+use strict;
+use Carp;
+use File::Spec;
+use BPB::Source::Compressed;
+use CPAN;
+use CPAN::HandleConfig;
+CPAN::HandleConfig->load();
+
+use base qw/BPB::Source::Base/;
+
+=head2 run
+
+=cut
+
+sub run {
+    my $self = shift;
+    $self->SUPER::run();
+    my $compressed = BPB::Source::Compressed->new(%$self);
+    $compressed->run();
+}
+
+sub _run {
+    my $self = shift;
+    my $module = CPAN::Shell->expand( 'Module', $self->source );
+    croak 'invalid module name: ' . $self->source unless $module;
+
+    $self->source(
+        File::Spec->catfile(
+            $CPAN::Config->{keep_source_where}, 'authors',
+            'id',                               $module->cpan_file
+        )
+    );
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+BPB::Source::CPAN - 
+
+
+=head1 SYNOPSIS
+
+  
+=head1 DESCRIPTION
+
+
+=head1 INTERFACE 
+
+
+=head1 DEPENDENCIES
+
+None.
+
+
+=head1 INCOMPATIBILITIES
+
+None reported.
+
+
+=head1 BUGS AND LIMITATIONS
+
+No bugs have been reported.
+
+=head1 AUTHOR
+
+sunnavy  C<< <sunnavy at bestpractical.com> >>
+
+
+=head1 LICENCE AND COPYRIGHT
+
+Copyright 2007 Best Practical Solutions.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.



More information about the Bps-public-commit mailing list