Permalink
Browse files

CloudPAN initial commit. IT IS BROKEN. PLAY WITH ME

  • Loading branch information...
0 parents commit 9c686388fd8737a867ed424ee1f8a8bbd6107c6c @nperez committed Apr 1, 2012
Showing with 112 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +4 −0 Changes
  3. +19 −0 dist.ini
  4. +39 −0 lib/CloudPAN.pm
  5. +46 −0 weaver.ini
@@ -0,0 +1,4 @@
+.build/
+*.swp
+*.tar.gz
+CPAN-Common-Index-*
@@ -0,0 +1,4 @@
+Revision history for {{ $dist->name }}: {{ $dist->version }}
+
+{{ $NEXT }}
+ Initial release
@@ -0,0 +1,19 @@
+name = CloudPAN
+author = Nicholas R. Perez <nperez@cpan.org>
+license = Perl_5
+copyright_holder = Nicholas R. Perez <nperez@cpan.org>
+copyright_year = 2012
+
+[@Basic]
+[AutoVersion]
+[PkgVersion]
+[PodWeaver]
+[AutoPrereqs]
+[Prereqs]
+[NextRelease]
+[PodSyntaxTests]
+[MetaJSON]
+[MetaResources]
+repository.url = git://github.com/nperez/cloudpan
+repository.type = git
+[@Git]
@@ -0,0 +1,39 @@
+package CloudPAN;
+use warnings;
+use strict;
+
+BEGIN {
+ require MetaCPAN::API::Tiny;
+ require Symbol;
+ use IO::All;
+ my $api = MetaCPAN::API::Tiny->new();
+
+ push(@INC, sub {
+ my ($self, $name) = @_;
+
+ my $ret = $api->fetch('module/_search', q => qq|path:lib/$name|, size => 1, fields => 'author,release,path' )
+ ->{hits}->{hits}->[0]->{fields} or die "Unable to fetch relevant info from MetaCPAN for $name";
+
+ my $req_url = join('/', $api->{base_url}, 'source', @{$ret}{qw/author release path/});
+
+ my $content = $api->{ua}->get($req_url)->{content};
+
+ my $io = io('/tmp/' . $name);
+ $io->assert;
+ $io->mode('>');
+ $io->print($content);
+ $io->close();
+
+ my @file = split(/(?=\n)/, $content)
+ or die "Unable to gather the actual source for $name";
+
+ my $reader = sub {
+ $_ = shift(@file);
+ return scalar(@file) > 0 ? 1 : 0;
+ };
+
+ return Symbol::gensym(), $reader;
+ });
+}
+
+1;
@@ -0,0 +1,46 @@
+[@CorePrep]
+
+[Name]
+[Version]
+
+[Generic / SYNOPSIS]
+[Generic / DESCRIPTION]
+[Generic / OVERVIEW]
+
+[Collect / CLASS_METHODS]
+command = class_method
+
+[Collect / ROLE_PARAMETERS]
+command = role_parameter
+[Collect / ROLE_REQUIRES]
+command = role_require
+
+[Collect / PUBLIC_ATTRIBUTES]
+command = attribute_public
+[Collect / PROTECTED_ATTRIBUTES]
+command = attribute_protected
+[Collect / PRIVATE_ATTRIBUTES]
+command = attribute_private
+
+[Collect / PUBLIC_METHODS]
+command = method_public
+[Collect / PROTECTED_METHODS]
+command = method_protected
+[Collect / PRIVATE_METHODS]
+command = method_private
+
+[Collect / EMITTED_EVENTS]
+command = emitted_event
+
+[Collect / TYPES]
+command = type
+[Collect / COERCIONS]
+command = coerce
+
+[Collect / CONSTANTS]
+command = constant
+
+[Leftovers]
+
+[Authors]
+[Legal]

0 comments on commit 9c68638

Please sign in to comment.