From a1e8f3b6937be2c8c03de3dfb09ca53ca62be88a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Thu, 7 May 2015 13:37:53 +0200
Subject: [PATCH] Adapt to Module-Starter-1.71
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Module-Starter 1.70 and 1.71 changed how test files are created. This
adjusts to the change.
Filtering t/boilerplate.t from MANIFEST is a hack. I don't understand why
it's not created into xt directory.
https://bugzilla.redhat.com/show_bug.cgi?id=1189463
https://rt.cpan.org/Public/Bug/Display.html?id=101894
https://github.com/xsawyerx/module-starter/issues/47#issuecomment-73425236
Signed-off-by: Petr PÃsaÅ <ppisar@redhat.com>
---
lib/Module/Starter/Plugin/CGIApp.pm | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/lib/Module/Starter/Plugin/CGIApp.pm b/lib/Module/Starter/Plugin/CGIApp.pm
index cb0f1b7..f3aa37b 100644
--- a/lib/Module/Starter/Plugin/CGIApp.pm
+++ b/lib/Module/Starter/Plugin/CGIApp.pm
@@ -125,7 +125,6 @@ sub create_distro {
push @files, $self->create_modules( @{ $self->{modules} } );
push @files, $self->create_t( @{ $self->{modules} } );
- push @files, $self->create_xt( @{ $self->{modules} } );
push @files, $self->create_tmpl();
my %build_results = $self->create_build();
push @files, @{ $build_results{files} };
@@ -147,7 +146,7 @@ sub _create_manifest {
my $file = File::Spec->catfile( $self->{basedir}, 'MANIFEST' );
open my $fh, '>', $file or croak "Can't open file $file: $OS_ERROR\n";
- foreach my $file ( sort @files ) {
+ foreach my $file ( grep !m{^\Qt/boilerplate.t\E$}, sort @files ) {
print {$fh} "$file\n" or croak "$OS_ERROR\n";
}
close $fh or croak "Can't close file $file: $OS_ERROR\n";
@@ -261,9 +260,7 @@ in the distribution.
sub create_t {
my ( $self, @modules ) = @_;
- my %t_files = $self->t_guts(@modules);
-
- my @files = map { $self->_create_t( $_, $t_files{$_} ) } keys %t_files;
+ my @files = $self->SUPER::create_t(@modules);
# This next part is for the static files dir t/www
my @dirparts = ( $self->{basedir}, 't', 'www' );
--
2.1.0