Anonymous avatar Anonymous committed a7af439

Added the Build.PL and got it to build. Made sure svn:ignore is clean.

Comments (0)

Files changed (7)

+use strict;
+use warnings;
+
+use File::Spec;
+use lib File::Spec->catdir(File::Spec->curdir(), "inc");
+
+use Test::Run::Builder;
+
+open O, ">", "lib/SVN/RaWeb/Light/Help.pm";
+print O <<'EOF';
+package SVN::RaWeb::Light::Help;
+
+sub print_data
+{
+    local $/;
+    print <DATA>;
+}
+
+1;
+EOF
+
+print O "__DATA__\n";
+
+{
+    local $/;
+    open I, "<", "docs/Help.html";
+    print O <I>;
+    close(I);
+}
+close(O);
+
+my $build = Test::Run::Builder->new(
+    module_name => 'SVN::RaWeb::Light',
+    dist_version_from => 'lib/SVN/RaWeb/Light.pm', # finds $VERSION
+    requires =>
+    {
+        'SVN::Ra' => 0,
+        'CGI' => 0,
+        'IO::Scalar' => 0,
+        'Class::Accessor' => 0,
+        'Test::More' => 0,
+    },
+    license => "bsd",
+    dist_author => 'Shlomi Fish <shlomif@iglu.org.il>',
+);
+
+$build->create_build_script;
+
 AUTHORS
+Build.PL
 Changes
 COPYING
 docs/Help.html
+examples/berlios.pl
+inc/Test/Run/Builder.pm
+lib/SVN/RaWeb/Light/Help.pm
+lib/SVN/RaWeb/Light.pm
 Makefile.PL
 MANIFEST
+META.yml                                 Module meta-data (added by MakeMaker)
 README
-t/SVN-RaWeb-Light.t
+SVN/RaWeb/Light/Mock/CGI.pm
+SVN/RaWeb/Light/Mock/Stdout.pm
+SVN/RaWeb/Light/Mock/Svn.pm
+SVN/RaWeb/Light/Test/LimitOutput.pm
 t/01output.t
 t/02unit.t
 t/03trans_unit.t
 t/04exceptions.t
-lib/SVN/RaWeb/Light.pm
-lib/SVN/RaWeb/Light/Help.pm
-examples/berlios.pl
-META.yml                                 Module meta-data (added by MakeMaker)
-SVN/RaWeb/Light/Mock/CGI.pm
-SVN/RaWeb/Light/Mock/Stdout.pm
-SVN/RaWeb/Light/Mock/Svn.pm
-SVN/RaWeb/Light/Test/LimitOutput.pm
 TODO
+t/SVN-RaWeb-Light.t
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
-name:         SVN-RaWeb-Light
-version:      0.6.0
-version_from: lib/SVN/RaWeb/Light.pm
-installdirs:  site
+---
+name: SVN-RaWeb-Light
+version: 0.6.0
+author:
+  - 'Shlomi Fish <shlomif@iglu.org.il>'
+abstract: |-
+  Lightweight and Fast Browser for a URLed Subversion 
+  repository similar to the default Subversion http:// hosting.
+license: bsd
+resources:
+  license: http://www.opensource.org/licenses/bsd-license.php
 requires:
-    CGI:                           0
-    Class::Accessor:               0
-    IO::Scalar:                    0
-    SVN::Ra:                       0
-    Test::More:                    0
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+  CGI: 0
+  Class::Accessor: 0
+  IO::Scalar: 0
+  SVN::Ra: 0
+  Test::More: 0
+provides:
+  SVN::RaWeb::Light:
+    file: lib/SVN/RaWeb/Light.pm
+    version: 0.6.0
+  SVN::RaWeb::Light::Help:
+    file: lib/SVN/RaWeb/Light/Help.pm
+generated_by: Module::Build version 0.2805
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.2.html
+  version: 1.2

To-Serve/berlios.pl

+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+
+use lib "../lib";
+
+use SVN::RaWeb::Light;
+
+my $app = SVN::RaWeb::Light->new(
+    'url' => "svn://svn.berlios.de/web-cpan/",
+    'url_translations' => 
+    [
+        {
+            'label' => "Read/Write URL",
+            'url' => "svn+ssh://svn.berlios.de/svnroot/repos/web-cpan/",
+        },
+        {
+            'label' => "Read URL",
+            'url' => "svn://svn.berlios.de/web-cpan/",
+        },
+    ],
+);
+
+$app->run();
+

To-Serve/fc-solve.pl

+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+
+use lib "../lib";
+
+use SVN::RaWeb::Light;
+
+my $app = SVN::RaWeb::Light->new(
+    'url' => "svn://svn.berlios.de/fc-solve/",
+    'url_translations' => 
+    [
+        {
+            'label' => "Read/Write URL",
+            'url' => "svn+ssh://svn.berlios.de/svnroot/repos/fc-solve/",
+        },
+        {
+            'label' => "Read URL",
+            'url' => "svn://svn.berlios.de/fc-solve/",
+        },
+    ],
+);
+
+$app->run();
+

To-Serve/serve.pl

+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+
+use lib "../lib";
+
+use SVN::RaWeb::Light;
+
+my $app = SVN::RaWeb::Light->new(
+    'url' => "http://localhost:8080/svn/repos/",
+);
+
+$app->run();
+

inc/Test/Run/Builder.pm

+package Test::Run::Builder;
+
+use strict;
+use warnings;
+
+use Module::Build;
+
+use vars qw(@ISA);
+
+@ISA = (qw(Module::Build));
+
+sub ACTION_runtest
+{
+    my ($self) = @_;
+    my $p = $self->{properties};
+
+    $self->depends_on('code');
+
+    local @INC = @INC;
+
+    # Make sure we test the module in blib/
+    unshift @INC, (File::Spec->catdir($p->{base_dir}, $self->blib, 'lib'),
+		 File::Spec->catdir($p->{base_dir}, $self->blib, 'arch'));
+
+    $self->do_test_run_tests;
+}
+
+sub ACTION_distruntest {
+  my ($self) = @_;
+
+  $self->depends_on('distdir');
+
+  my $start_dir = $self->cwd;
+  my $dist_dir = $self->dist_dir;
+  chdir $dist_dir or die "Cannot chdir to $dist_dir: $!";
+  # XXX could be different names for scripts
+
+  $self->run_perl_script('Build.PL') # XXX Should this be run w/ --nouse-rcfile
+      or die "Error executing 'Build.PL' in dist directory: $!";
+  $self->run_perl_script('Build')
+      or die "Error executing 'Build' in dist directory: $!";
+  $self->run_perl_script('Build', [], ['runtest'])
+      or die "Error executing 'Build test' in dist directory";
+  chdir $start_dir;
+}
+
+sub do_test_run_tests
+{
+    my $self = shift;
+
+    require Test::Run::CmdLine::Iface;
+
+    my $test_run =
+        Test::Run::CmdLine::Iface->new(
+            {
+                'test_files' => [glob("t/*.t")],
+            }   
+            # 'backend_params' => $self->_get_backend_params(),
+        );
+
+    return $test_run->run();
+}
+
+1;
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.