Commits

Shlomi Fish committed 10bafb8

Convert to Build.PL.

Comments (0)

Files changed (5)

Web-Directory-for-Artwork/App-WebWorksDir/Build.PL

+use strict;
+use warnings;
+
+use lib './inc';
+
+use Test::Run::Builder;
+
+my $builder = Test::Run::Builder->new(
+    module_name                => 'App::WebWorksDir',
+    license                    => 'artistic_2',
+    dist_abstract              => "Web-based directory for various works, similar to Freecode",
+    dist_author                => q{Shlomi Fish <shlomif@cpan.org>},
+    dist_version_from        => 'lib/App/WebWorksDir.pm',
+    requires => {
+        'YAML'       => 0,
+        'Dancer'     => 1.311,
+    },
+    build_requires => {
+        'Test::More' => 0,
+    },
+    configure_requires => {
+        'Module::Build' => 0,
+    },
+    create_makefile_pl => 'traditional',
+    meta_merge =>
+    {
+        keywords =>
+        [
+            'freecode',
+            'freshmeat',
+            'directory',
+            'works',
+            'art',
+            'fiction',
+            'comments',
+        ],
+    }
+);
+
+$builder->create_build_script();

Web-Directory-for-Artwork/App-WebWorksDir/MANIFEST

-MANIFEST
 bin/app.pl
+Build
+Build.PL
+Build.PL~
 config.yml
 environments/development.yml
 environments/production.yml
+inc/Test/Run/Builder.pm
+lib/App/WebWorksDir.pm
+Makefile.PL
+MANIFEST
+MANIFEST.SKIP
+MANIFEST.SKIP~
+META.json
+META.yml
+public/404.html
+public/500.html
+public/css/error.css
+public/css/style.css
+public/dispatch.cgi
+public/dispatch.fcgi
+public/favicon.ico
+public/images/perldancer-bg.jpg
+public/images/perldancer.jpg
+public/javascripts/jquery.js
+t/001_base.t
+t/002_index_route.t
 views/index.tt
 views/layouts/main.tt
-MANIFEST.SKIP
-lib/App/WebWorksDir.pm
-public/css/style.css
-public/css/error.css
-public/images/perldancer-bg.jpg
-public/images/perldancer.jpg
-public/500.html
-public/404.html
-public/dispatch.fcgi
-public/favicon.ico
-public/dispatch.cgi
-public/javascripts/jquery.js
-t/002_index_route.t
-t/001_base.t
-Makefile.PL

Web-Directory-for-Artwork/App-WebWorksDir/MANIFEST.SKIP

+^App-WebWorksDir-(\d+\.)*\d+(?:/|tar)
+^_build/
 ^\.git\/
 maint
 ^tags$
 ^cover_db
 ^.*\.log
 ^.*\.swp$
+^MYMETA\.yml$
+^MYMETA\.json$

Web-Directory-for-Artwork/App-WebWorksDir/Makefile.PL

-use strict;
-use warnings;
+# Note: this file was auto-generated by Module::Build::Compat version 0.39_01
 use ExtUtils::MakeMaker;
-
-WriteMakefile(
-    NAME                => 'App::WebWorksDir',
-    AUTHOR              => q{YOUR NAME <youremail@example.com>},
-    VERSION_FROM        => 'lib/App/WebWorksDir.pm',
-    ABSTRACT            => 'YOUR APPLICATION ABSTRACT',
-    ($ExtUtils::MakeMaker::VERSION >= 6.3002
-      ? ('LICENSE'=> 'perl')
-      : ()),
-    PL_FILES            => {},
-    PREREQ_PM => {
-        'Test::More' => 0,
-        'YAML'       => 0,
-        'Dancer'     => 1.311,
-    },
-    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
-    clean               => { FILES => 'App-WebWorksDir-*' },
-);
+WriteMakefile
+(
+  'NAME' => 'App::WebWorksDir',
+  'VERSION_FROM' => 'lib/App/WebWorksDir.pm',
+  'PREREQ_PM' => {
+                   'Dancer' => '1.311',
+                   'Test::More' => 0,
+                   'YAML' => 0
+                 },
+  'INSTALLDIRS' => 'site',
+  'EXE_FILES' => [
+                   'bin/app.pl'
+                 ],
+  'PL_FILES' => {}
+)
+;

Web-Directory-for-Artwork/App-WebWorksDir/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();
+}
+
+sub ACTION_tags
+{
+    return 
+        system(qw(
+            ctags -f tags --recurse --totals
+    		--exclude=blib/** --exclude=t/lib/**
+    		--exclude=.svn --exclude='*~'
+    		--languages=Perl --langmap=Perl:+.t
+    ));
+}
+
+1;
+