Merge from chris
Tomas Doran (t0m) [Sat, 6 Jun 2009 22:03:56 +0000 (23:03 +0100)]
MANIFEST.SKIP [new file with mode: 0644]
Makefile.PL
t/01_notabs.t [new file with mode: 0644]
t/02_pod.t [new file with mode: 0644]
t/03_pod_coverage.t [new file with mode: 0644]

diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP
new file mode 100644 (file)
index 0000000..dd1c6f9
--- /dev/null
@@ -0,0 +1,23 @@
+^_build
+^Build$
+^blib
+~$
+\.bak$
+CVS
+\.svn
+\.DS_Store
+cover_db
+\..*\.sw.?$
+^Makefile$
+^pm_to_blib$
+^MakeMaker-\d
+^blibdirs$
+\.old$
+^#.*#$
+^\.#
+^TODO$
+^PLANS$
+^\._.*$
+\.shipit
+^Catalyst-.*
+\.git.*
index 95ab173..b598ed5 100644 (file)
@@ -1,16 +1,16 @@
 use inc::Module::Install;
 use 5.008006;
-  
+
 license  'perl';
 
 name     'Catalyst-Engine-Stomp';
 all_from 'lib/Catalyst/Engine/Stomp.pm';
-  
+
 requires 'Catalyst::Engine::Embeddable'  => '0.0.1';
 requires 'Catalyst::Runtime'  => '5.80004';
 requires 'Moose' => undef;
 requires 'MooseX::Workers' => '0.05';
-requires 'Net::Stomp' => '0.34';  
+requires 'Net::Stomp' => '0.34';
 requires 'YAML::XS' => '0.32';
 requires 'Data::Serializer' => '0.49';
 requires 'namespace::autoclean' => '0.05';
@@ -21,6 +21,64 @@ no_index package => 'StompTestApp';
 no_index package => 'StompTestApp::Controller::TestController';
 no_index package => 'StompTestApp::Controller::TestJsonController';
 
+my @force_build_requires_if_author = qw(
+  Test::NoTabs
+  Test::Pod
+  Test::Pod::Coverage
+  Pod::Coverage
+);
+
+if ($Module::Install::AUTHOR) {
+    foreach my $module (@force_build_requires_if_author) {
+        build_requires $module;
+    }
+    darwin_check_no_resource_forks();
+}
+
+install_script glob('script/*.pl');
 auto_install;
 WriteAll;
 
+if ($Module::Install::AUTHOR) {
+
+  # Strip out the author only build_requires from META.yml
+  # Need to do this _after_ WriteAll else it looses track of them
+  strip_author_only_build_requires(@force_build_requires_if_author);
+
+  Meta->{values}{resources} = [
+    [ 'license',    => 'http://dev.perl.org/licenses/' ],
+    [ 'repository', => 'git://github.com/chrisa/catalyst-engine-stomp.git' ],
+  ];
+
+  Meta->write;
+}
+
+sub darwin_check_no_resource_forks {
+    if ($^O eq 'darwin') {
+        my $osx_ver = `/usr/bin/sw_vers -productVersion`;
+        chomp $osx_ver;
+
+        # TAR on 10.4 wants COPY_EXTENDED_ATTRIBUTES_DISABLE
+        # On 10.5 (Leopard) it wants COPYFILE_DISABLE
+        my $attr = $osx_ver eq '10.5' ? 'COPYFILE_DISABLE' : 'COPY_EXTENDED_ATTRIBUTES_DISABLE';
+
+        makemaker_args(dist => { PREOP => qq{\@if [ "\$\$$attr" != "true" ]; then}.
+                                          qq{ echo "You must set the ENV variable $attr to true,"; }.
+                                          ' echo "to avoid getting resource forks in your dist."; exit 255; fi' });
+        }
+}
+
+sub strip_author_only_build_requires {
+    my @build_requires_to_strip = @_;
+    Meta->{values}{build_requires} = [ grep {
+      my $ok = 1;
+      foreach my $module (@build_requires_to_strip) {
+        if ($_->[0] =~ /$module/) {
+          $ok = 0;
+          last;
+        }
+      }
+      $ok;
+    } @{Meta->{values}{build_requires}} ];
+}
+
diff --git a/t/01_notabs.t b/t/01_notabs.t
new file mode 100644 (file)
index 0000000..391abe7
--- /dev/null
@@ -0,0 +1,20 @@
+use strict;
+use warnings;
+
+use File::Spec;
+use Test::More;
+
+if ( !-e "inc/.author" ) {
+    plan skip_all => 'NoTabs test only for developers.';
+}
+else {
+    eval { require Test::NoTabs };
+    if ( $@ ) {
+        plan tests => 1;
+        fail( 'You must install Test::NoTabs to run 01_no_tabs.t' );
+        exit;
+    }
+}
+
+Test::NoTabs->import;
+all_perl_files_ok(qw/lib/);
diff --git a/t/02_pod.t b/t/02_pod.t
new file mode 100644 (file)
index 0000000..05aa78a
--- /dev/null
@@ -0,0 +1,7 @@
+use Test::More;
+
+eval "use Test::Pod 1.14";
+plan skip_all => 'Test::Pod 1.14 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD} || -e 'inc/.author';
+
+all_pod_files_ok();
diff --git a/t/03_pod_coverage.t b/t/03_pod_coverage.t
new file mode 100644 (file)
index 0000000..5270b82
--- /dev/null
@@ -0,0 +1,13 @@
+use Test::More;
+
+eval "use Pod::Coverage 0.19";
+plan skip_all => 'Pod::Coverage 0.19 required' if $@;
+eval "use Test::Pod::Coverage 1.04";
+plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD} || -e 'inc/.author';
+
+all_pod_coverage_ok(
+  {
+    also_private => [qw/BUILD BUILDARGS/]
+  }
+);