From db1a1bd5069dff5d4c7dc27b2e2e07fdb328e59d Mon Sep 17 00:00:00 2001 From: Tomas Doran Date: Thu, 3 Dec 2009 01:20:17 +0000 Subject: [PATCH] Updates / additions for how I do dists --- Makefile.PL | 9 +++++---- data/MANIFEST.SKIP | 1 + data/Makefile.PL | 26 ++++++++++++++++++++++---- data/gitignore | 1 + data/t/00-load.t | 6 ++++-- data/t/author/pod-coverage.t | 7 ++++--- data/t/author/pod.t | 7 ++++--- data/t/live-test.t | 3 ++- lib/CatalystX/Starter.pm | 21 ++++++++++++++++++--- 9 files changed, 61 insertions(+), 20 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 16328bc..e9e8b01 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,4 +1,6 @@ -use inc::Module::Install; +use strict; +use warnings; +use inc::Module::Install 0.91; name('CatalystX-Starter'); all_from('lib/CatalystX/Starter.pm'); @@ -6,9 +8,8 @@ all_from('lib/CatalystX/Starter.pm'); requires 'Catalyst::Runtime'; requires 'Catalyst::Devel'; requires 'Test::More'; -requires 'ok'; -requires 'Test::Pod'; -requires 'Test::Pod::Coverage'; +requires 'Test::Pod' => '1.14'; +requires 'Test::Pod::Coverage' => '1.04'; requires 'File::ShareDir'; requires 'File::Copy::Recursive'; requires 'File::Slurp'; diff --git a/data/MANIFEST.SKIP b/data/MANIFEST.SKIP index 8fb2024..a0282be 100644 --- a/data/MANIFEST.SKIP +++ b/data/MANIFEST.SKIP @@ -6,3 +6,4 @@ MANIFEST.SKIP~ cover_db Makefile$ Makefile.old$ +^[% DIST_NAME %]- diff --git a/data/Makefile.PL b/data/Makefile.PL index bdb66a9..4ae002b 100644 --- a/data/Makefile.PL +++ b/data/Makefile.PL @@ -1,11 +1,29 @@ -use inc::Module::Install; +use strict; +use warnings; +use inc::Module::Install 0.91; +use Module::Install::AuthorRequires; +use Module::Install::AuthorTests; name '[% DIST_NAME %]'; all_from '[% MAIN_MODULE_PATH %]'; -build_requires 'Catalyst::Runtime'; +requires 'Moose'; +requires 'namespace::autoclean'; + +build_requires 'Catalyst::Runtime' => '5.80'; build_requires 'Test::WWW::Mechanize::Catalyst'; -build_requires 'Test::More'; -build_requires 'ok'; +build_requires 'Test::More' => '0.88'; + +author_requires 'Test::Pod::Coverage' => '1.04'; +author_requires 'Test::Pod' => '1.14'; + +author_tests 't/author'; + +resources repository => 'git://somewhere.com/myproject.git'; + +if ($Module::Install::AUTHOR) { + system("pod2text [% MAIN_MODULE_PATH %] > README") + and die $!; +} WriteAll(); diff --git a/data/gitignore b/data/gitignore index bfd20cf..d05585e 100644 --- a/data/gitignore +++ b/data/gitignore @@ -6,3 +6,4 @@ inc pm_to_blib MANIFEST Makefile.old +[% DIST_NAME %]-* diff --git a/data/t/00-load.t b/data/t/00-load.t index f097fc7..ac2ca33 100644 --- a/data/t/00-load.t +++ b/data/t/00-load.t @@ -2,5 +2,7 @@ use strict; use warnings; -use Test::More tests => 1; -use ok '[% MODULE %]'; +use Test::More; +use_ok '[% MODULE %]'; + +done_testing; diff --git a/data/t/author/pod-coverage.t b/data/t/author/pod-coverage.t index 703f91d..83b1a5d 100644 --- a/data/t/author/pod-coverage.t +++ b/data/t/author/pod-coverage.t @@ -1,6 +1,7 @@ -#!perl -T +#!/usr/bin/env perl +use strict; +use warnings; use Test::More; -eval "use Test::Pod::Coverage 1.04"; -plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; +use Test::Pod::Coverage 1.04; all_pod_coverage_ok(); diff --git a/data/t/author/pod.t b/data/t/author/pod.t index 976d7cd..08d2afd 100644 --- a/data/t/author/pod.t +++ b/data/t/author/pod.t @@ -1,6 +1,7 @@ -#!perl -T +#!/usr/bin/env perl +use strict; +use warnings; use Test::More; -eval "use Test::Pod 1.14"; -plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; +use Test::Pod 1.14; all_pod_files_ok(); diff --git a/data/t/live-test.t b/data/t/live-test.t index 88a3380..4ca1c81 100644 --- a/data/t/live-test.t +++ b/data/t/live-test.t @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 3; +use Test::More; # setup library path use FindBin qw($Bin); @@ -17,3 +17,4 @@ my $mech = Test::WWW::Mechanize::Catalyst->new; $mech->get_ok('http://localhost/', 'get main page'); $mech->content_like(qr/it works/i, 'see if it has our text'); +done_testing; diff --git a/lib/CatalystX/Starter.pm b/lib/CatalystX/Starter.pm index 29c0a6f..34a3bf0 100644 --- a/lib/CatalystX/Starter.pm +++ b/lib/CatalystX/Starter.pm @@ -89,16 +89,31 @@ sub _mk_module { my $data = <<"MOD"; # indented to prevent pod parser from parsing it package $module; - use strict; - use warnings; + use Moose; + use namespace::autoclean; + + 1; =head1 NAME $module - + =head1 DESCRIPTION + + =head1 METHODS + + =head1 BUGS + + =head1 AUTHOR + + =head1 COPYRIGHT & LICENSE + + Copyright 2009 the above author(s). + + This sofware is free software, and is licensed under the same terms as perl itself. + =cut - 1; MOD $data =~ s/^ //mg; # cleanup the leading space