Permalink
Browse files

Initial revision

  • Loading branch information...
1 parent e4a4973 commit eb92fdc3bd80c39ecdf82bdaffdf6885a1339194 @davorg committed Oct 30, 2004
Showing with 111 additions and 0 deletions.
  1. +28 −0 index.tt
  2. +43 −0 pod
  3. +40 −0 release
View
@@ -0,0 +1,28 @@
+[% USE YAML;
+ meta = YAML.undumpfile('META.yml') -%]
+<html>
+ <head>
+ <link rel="stylesheet" href="/dave.css" type="text/css" />
+ <title>[% meta.name %]</title>
+ </head>
+ <body>
+ <h1>[% meta.name %]</h1>
+ <p>Current version [% meta.version %]</p>
+ <p>[% meta.abstract | html %]</p>
+ <ul>
+ <li>Download <a href="[% meta.name %]-[% meta.version %].tar.gz">latest version</a></li>
+ <li>View <a href="dist/README">README</a></li>
+ <li>Browse <a href="dist">distribution</a></li>
+ <li>View <a href="cover">test coverage</a></li>
+ <li>Modules:
+ <ul>[% IF meta.provides.keys.size;
+ FOREACH module IN meta.provides.keys %]
+ <li><a href="/cgi-bin/pod?/code/[% meta.name %]/dist/[% meta.provides.$module.file %]">[% module %]</a> ([% meta.provides.$module.version %])</li>
+ [% END %]
+ [% ELSE %]
+ <li><a href="/cgi-bin/pod?/code/[% meta.name %]/dist/[% meta.version_from %]">[% meta.version_from.split('/').last.replace('-', '::') %]</a> ([% meta.version %])</li>
+ [% END %]</ul></li>
+ <li>Browse <a href="http://cvs.dave.org.uk/index.cgi/[% meta.name %]/">cvs</a></li>
+ </ul>
+ </body>
+</html>
View
@@ -0,0 +1,43 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+package Pod::POM::View::HTML::davorg;
+
+use base 'Pod::POM::View::HTML';
+
+sub view_pod {
+ my ($self, $pod) = @_;
+
+ my $content = $pod->content->present($self);
+ $content =~ s|</pre>\n\n<pre>|\n\n|g;
+
+ return '<html>
+ <head>
+ <link rel="stylesheet" href="/dave.css" type="text/css" />
+ <link rel="stylesheet" href="/code/style.css" type="text/css" />
+ </head>
+ <body>' .
+ $content .
+ ' </body>
+</html>';
+}
+
+package main;
+
+use Pod::POM;
+use Cwd;
+use CGI qw(header);
+use CGI::Carp 'fatalsToBrowser';
+
+my $file = "$ENV{DOCUMENT_ROOT}/$ENV{QUERY_STRING}";
+
+unless (-e $file) {
+ die "No such file: $file";
+}
+
+my $p = Pod::POM->new;
+my $pom = $p->parse_file($file);
+print header, Pod::POM::View::HTML::davorg->print($pom);
+
View
@@ -0,0 +1,40 @@
+#!/usr/bin/perl
+
+use File::Copy;
+use Template;
+use YAML 'LoadFile';
+use constant TT => '/home/dave/src/release';
+
+my $meta = LoadFile('META.yml');
+
+my $build;
+if (-f 'Build.PL') {
+ $build = { start => './Build.PL', cmd => './Build' };
+} else {
+ $build = { start => './Makefile.PL', cmd => 'make' };
+}
+
+system "perl $build->{start}";
+system "cover -delete";
+system "HARNESS_PERL_SWITCHES=-MDevel::Cover $build->{cmd} test";
+system "cover";
+
+mkdir "$meta->{name}";
+mkdir "$meta->{name}/cover";
+foreach (<cover_db/*.html>, <cover_db/*.css>) {
+ s|^cover_db/||;
+ copy "cover_db/$_", "$meta->{name}/cover/$_";
+}
+move "$meta->{name}/cover/coverage.html", "$meta->{name}/cover/index.html";
+
+my $t = Template->new({INCLUDE_PATH => TT});
+$t->process('index.tt', {}, "$meta->{name}/index.html")
+ or die $t->error;
+
+my $ver = "$meta->{name}-$meta->{version}";
+copy "$ver.tar.gz", "$meta->{name}";
+chdir "$meta->{name}";
+system "zcat $ver.tar.gz | tar xvf -";
+move $ver, 'dist';
+chdir '..';
+system "scp -r ./$meta->{name} davorg\@dave.org.uk:httpdocs/code/";

0 comments on commit eb92fdc

Please sign in to comment.