r67924 - in /trunk/libcatalyst-devel-perl: ./ debian/ inc/Module/Install/ lib/Catalyst/ lib/Module/Install/ share/lib/ share/script/ share/t/ t/ t/author/ xt/
ansgar at users.alioth.debian.org
ansgar at users.alioth.debian.org
Thu Jan 27 12:09:15 UTC 2011
Author: ansgar
Date: Thu Jan 27 12:08:59 2011
New Revision: 67924
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=67924
Log:
* New upstream release.
* No longer run POD tests.
* Add (build-)dep on libyaml-tiny-perl.
* Add myself to Uploaders.
Added:
trunk/libcatalyst-devel-perl/inc/Module/Install/AuthorTests.pm
- copied unchanged from r67923, branches/upstream/libcatalyst-devel-perl/current/inc/Module/Install/AuthorTests.pm
trunk/libcatalyst-devel-perl/t/author/
- copied from r67923, branches/upstream/libcatalyst-devel-perl/current/t/author/
Removed:
trunk/libcatalyst-devel-perl/t/02pod.t
trunk/libcatalyst-devel-perl/t/03podcoverage.t
trunk/libcatalyst-devel-perl/xt/
Modified:
trunk/libcatalyst-devel-perl/Changes
trunk/libcatalyst-devel-perl/MANIFEST
trunk/libcatalyst-devel-perl/META.yml
trunk/libcatalyst-devel-perl/Makefile.PL
trunk/libcatalyst-devel-perl/debian/changelog
trunk/libcatalyst-devel-perl/debian/control
trunk/libcatalyst-devel-perl/debian/rules
trunk/libcatalyst-devel-perl/lib/Catalyst/Devel.pm
trunk/libcatalyst-devel-perl/lib/Catalyst/Helper.pm
trunk/libcatalyst-devel-perl/lib/Module/Install/Catalyst.pm
trunk/libcatalyst-devel-perl/share/lib/MyApp.pm.tt
trunk/libcatalyst-devel-perl/share/script/myapp_fastcgi.pl.tt
trunk/libcatalyst-devel-perl/share/script/myapp_server.pl.tt
trunk/libcatalyst-devel-perl/share/t/01app.t.tt
trunk/libcatalyst-devel-perl/share/t/comptest.tt
trunk/libcatalyst-devel-perl/t/generated_app.t
Modified: trunk/libcatalyst-devel-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-devel-perl/Changes?rev=67924&op=diff
==============================================================================
--- trunk/libcatalyst-devel-perl/Changes (original)
+++ trunk/libcatalyst-devel-perl/Changes Thu Jan 27 12:08:59 2011
@@ -1,4 +1,35 @@
This file documents the revision history for Perl extension Catalyst-Devel.
+
+1.31 2011-01-20 01:08:00
+ - Fix for copying generated files into installed apps + tests
+ to ensure it keeps working. abraxxa++
+ - Make Pod tests author only
+
+1.30 2011-01-11 23:54:00
+ - Increased Catalyst::Plugin::ConfigLoader dependency to 0.30
+ - Include File::Copy::Recursive in inc/ when building a dist of an
+ application.
+
+1.29 2011-01-11 23:51:00
+ - Add documentation for the --proc_title option to the generated
+ fastcgi scripts
+ - Don't bother with the BEGIN { use_ok dance for created tests
+ - the test will fail to compile (and ergo fail) using just use,
+ and that's less typing (and less copy-pasting)
+ - Split method for creating tests into multiple methods to allow
+ subclasses to override the generation of some tests.
+ - Allow the author to be defined in the call to ->new to help things
+ which want to call Catalyst::Helper programatically.
+ - Remove $VERSION = eval $VERSION handwave in generated code as:
+ - Gives a perl critic violation.
+ - If you're shipping a dev release, best practice is you should do
+ it by renaming the tarball, rather than having a _ in the VERSION.
+ - Allow catalyst.pl . to work for already created applications
+ when in the application's directory.
+ - Note that plugin order is important in the generated skeleton.
+ - Don't pollute M::I plugin detector with GetOptions symbol from
+ GetOpt::Long
+ - Fix typo in share/script/myapp_server.pl.tt (RT #58475)
1.28 2010-06-16 02:43:00
- Fix generated Pod tests so that the first check is if the TEST_POD
Modified: trunk/libcatalyst-devel-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-devel-perl/MANIFEST?rev=67924&op=diff
==============================================================================
--- trunk/libcatalyst-devel-perl/MANIFEST (original)
+++ trunk/libcatalyst-devel-perl/MANIFEST Thu Jan 27 12:08:59 2011
@@ -2,6 +2,7 @@
inc/Module/AutoInstall.pm
inc/Module/Install.pm
inc/Module/Install/AuthorRequires.pm
+inc/Module/Install/AuthorTests.pm
inc/Module/Install/AutoInstall.pm
inc/Module/Install/Base.pm
inc/Module/Install/Can.pm
@@ -48,8 +49,9 @@
share/t/03podcoverage.t.tt
share/t/comptest.tt
t/01use.t
-t/02pod.t
-t/03podcoverage.t
+t/author/pod.t
+t/author/podcoverage.t
+t/author/version_numbers.t
t/back_compat.t
t/generated_app.t
t/get_sharedir_file.t
@@ -62,4 +64,3 @@
t/optional_http-server-restart.t
t/render_file_contents.t
t/render_share_dir_file.t
-xt/version_numbers.t
Modified: trunk/libcatalyst-devel-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-devel-perl/META.yml?rev=67924&op=diff
==============================================================================
--- trunk/libcatalyst-devel-perl/META.yml (original)
+++ trunk/libcatalyst-devel-perl/META.yml Thu Jan 27 12:08:59 2011
@@ -19,11 +19,10 @@
- inc
- share
- t
- - xt
requires:
Catalyst: 5.80015
Catalyst::Action::RenderView: 0.10
- Catalyst::Plugin::ConfigLoader: 0.23
+ Catalyst::Plugin::ConfigLoader: 0.30
Catalyst::Plugin::Static::Simple: 0.28
Config::General: 2.42
ExtUtils::MakeMaker: 6.11
@@ -44,4 +43,4 @@
homepage: http://dev.catalyst.perl.org/
license: http://dev.perl.org/licenses/
repository: git://git.shadowcat.co.uk/catagits/Catalyst-Devel.git
-version: 1.28
+version: 1.31
Modified: trunk/libcatalyst-devel-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-devel-perl/Makefile.PL?rev=67924&op=diff
==============================================================================
--- trunk/libcatalyst-devel-perl/Makefile.PL (original)
+++ trunk/libcatalyst-devel-perl/Makefile.PL Thu Jan 27 12:08:59 2011
@@ -2,6 +2,7 @@
use warnings;
use inc::Module::Install 0.91;
use Module::Install::AuthorRequires;
+use Module::Install::AuthorTests;
name 'Catalyst-Devel';
all_from 'lib/Catalyst/Devel.pm';
@@ -14,13 +15,19 @@
requires 'Catalyst' => '5.80015';
requires 'Catalyst::Action::RenderView' => '0.10';
requires 'Catalyst::Plugin::Static::Simple' => '0.28';
-requires 'Catalyst::Plugin::ConfigLoader' => '0.23';
+requires 'Catalyst::Plugin::ConfigLoader' => '0.30';
requires 'Config::General' => '2.42'; # as of 1.07, we use .conf and not .yaml
requires 'File::ChangeNotify' => '0.07';
requires 'File::Copy::Recursive';
-requires 'Module::Install' => '0.91';
requires 'Path::Class' => '0.09';
requires 'Template' => '2.14';
+
+# The Catalyst applications this module distribution have a Makefile.PL using
+# Module::Install as well as the Module::Install::Catalyst extension included in
+# this distribution. Therefore we really *depend* on Module::Install to be
+# installed, even though we also use it to build this distribution and include
+# it in its inc/ directory for releases.
+requires 'Module::Install' => '0.91';
author_requires 'IPC::Run3';
author_requires 'Module::Info';
@@ -29,6 +36,8 @@
test_requires 'Test::More' => '0.94';
install_share 'share';
+
+author_tests 't/author';
if ( $^O eq 'MSWin32' ) {
# Proc::Background needs this on Win32 but doesn't actually
Modified: trunk/libcatalyst-devel-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-devel-perl/debian/changelog?rev=67924&op=diff
==============================================================================
--- trunk/libcatalyst-devel-perl/debian/changelog (original)
+++ trunk/libcatalyst-devel-perl/debian/changelog Thu Jan 27 12:08:59 2011
@@ -1,8 +1,15 @@
-libcatalyst-devel-perl (1.28-2) UNRELEASED; urgency=low
+libcatalyst-devel-perl (1.31-1) unstable; urgency=low
+ [ gregor herrmann ]
* Set Standards-Version to 3.9.1; replace Conflicts with Breaks.
- -- gregor herrmann <gregoa at debian.org> Sat, 31 Jul 2010 14:19:10 -0400
+ [ Ansgar Burchardt ]
+ * New upstream release.
+ * No longer run POD tests.
+ * Add (build-)dep on libyaml-tiny-perl.
+ * Add myself to Uploaders.
+
+ -- Ansgar Burchardt <ansgar at debian.org> Thu, 27 Jan 2011 13:08:10 +0100
libcatalyst-devel-perl (1.28-1) unstable; urgency=low
Modified: trunk/libcatalyst-devel-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-devel-perl/debian/control?rev=67924&op=diff
==============================================================================
--- trunk/libcatalyst-devel-perl/debian/control (original)
+++ trunk/libcatalyst-devel-perl/debian/control Thu Jan 27 12:08:59 2011
@@ -1,16 +1,17 @@
Source: libcatalyst-devel-perl
Section: perl
Priority: optional
-Build-Depends: debhelper (>= 7.0.50)
+Build-Depends: debhelper (>= 7)
Build-Depends-Indep: perl, libmoosex-emulate-class-accessor-fast-perl,
libnamespace-autoclean-perl, libcatalyst-modules-perl, libtemplate-perl,
libmodule-install-perl (>= 0.91), libfile-changenotify-perl, libmoose-perl,
libconfig-general-perl (>= 2.42), libpath-class-perl, libfile-sharedir-perl,
- libcatalyst-perl (>= 5.80015), libfile-copy-recursive-perl, libtest-pod-perl,
+ libcatalyst-perl (>= 5.80015), libfile-copy-recursive-perl,
libnamespace-clean-perl, libtest-simple-perl (>= 0.94),
- libtest-pod-coverage-perl, libipc-run3-perl, libpod-coverage-perl (>= 0.20)
+ libipc-run3-perl, libyaml-tiny-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Jonathan Yu <jawnsy at cpan.org>, gregor herrmann <gregoa at debian.org>
+Uploaders: Jonathan Yu <jawnsy at cpan.org>, gregor herrmann <gregoa at debian.org>,
+ Ansgar Burchardt <ansgar at debian.org>
Standards-Version: 3.9.1
Homepage: http://search.cpan.org/dist/Catalyst-Devel/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libcatalyst-devel-perl/
@@ -22,7 +23,7 @@
libmoosex-emulate-class-accessor-fast-perl, libtemplate-perl, libmoose-perl,
libnamespace-clean-perl, libnamespace-autoclean-perl, libfile-sharedir-perl,
libfile-changenotify-perl, libfile-copy-recursive-perl, libpath-class-perl,
- libconfig-general-perl (>= 2.42)
+ libconfig-general-perl (>= 2.42), libyaml-tiny-perl
Suggests: libmodule-install-perl (>= 0.91)
Breaks: libcatalyst-modules-perl (<< 39)
Replaces: libcatalyst-modules-perl (<< 39)
Modified: trunk/libcatalyst-devel-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-devel-perl/debian/rules?rev=67924&op=diff
==============================================================================
--- trunk/libcatalyst-devel-perl/debian/rules (original)
+++ trunk/libcatalyst-devel-perl/debian/rules Thu Jan 27 12:08:59 2011
@@ -2,6 +2,3 @@
%:
dh $@
-
-override_dh_auto_test:
- TEST_POD=1 dh_auto_test
Modified: trunk/libcatalyst-devel-perl/lib/Catalyst/Devel.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-devel-perl/lib/Catalyst/Devel.pm?rev=67924&op=diff
==============================================================================
--- trunk/libcatalyst-devel-perl/lib/Catalyst/Devel.pm (original)
+++ trunk/libcatalyst-devel-perl/lib/Catalyst/Devel.pm Thu Jan 27 12:08:59 2011
@@ -4,7 +4,7 @@
use warnings;
# Change Catalyst::Helper also.
-our $VERSION = '1.28';
+our $VERSION = '1.31';
our $CATALYST_SCRIPT_GEN = 40;
$VERSION = eval $VERSION;
Modified: trunk/libcatalyst-devel-perl/lib/Catalyst/Helper.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-devel-perl/lib/Catalyst/Helper.pm?rev=67924&op=diff
==============================================================================
--- trunk/libcatalyst-devel-perl/lib/Catalyst/Helper.pm (original)
+++ trunk/libcatalyst-devel-perl/lib/Catalyst/Helper.pm Thu Jan 27 12:08:59 2011
@@ -13,12 +13,13 @@
use Catalyst::Exception;
use Path::Class qw/dir file/;
use File::ShareDir qw/dist_dir/;
+use YAML::Tiny;
use namespace::autoclean;
with 'MooseX::Emulate::Class::Accessor::Fast';
# Change Catalyst/Devel.pm also
-our $VERSION = '1.28';
+our $VERSION = '1.31';
my %cache;
@@ -78,13 +79,31 @@
# Needs to be here for PAR
require Catalyst;
+ if($name eq '.') {
+ if(!-e 'META.yml') {
+ system perl => 'Makefile.PL'
+ and Catalyst::Exception->throw(message => q(
+ Failed to run "perl Makefile.PL".
+ ));
+ }
+
+ $name = YAML::Tiny->read('META.yml')->[0]->{'name'};
+ $name =~ s/-/::/g;
+ $self->{dir} = '.';
+ }
+
if ( $name =~ /[^\w:]/ || $name =~ /^\d/ || $name =~ /\b:\b|:{3,}/) {
warn "Error: Invalid application name.\n";
return 0;
}
+
+
+ if(!defined $self->{'dir'}) {
+ $self->{dir} = $name;
+ $self->{dir} =~ s/\:\:/-/g;
+ }
+
$self->{name } = $name;
- $self->{dir } = $name;
- $self->{dir } =~ s/\:\:/-/g;
$self->{script } = dir( $self->{dir}, 'script' );
$self->{appprefix } = Catalyst::Utils::appprefix($name);
$self->{appenv } = Catalyst::Utils::class2env($name);
@@ -93,7 +112,7 @@
: "#!$Config{perlpath}";
$self->{scriptgen } = $Catalyst::Devel::CATALYST_SCRIPT_GEN;
$self->{catalyst_version} = $Catalyst::VERSION;
- $self->{author } = $self->{author} = $ENV{'AUTHOR'}
+ $self->{author } ||= $ENV{'AUTHOR'}
|| eval { @{ [ getpwuid($<) ] }[6] }
|| 'Catalyst developer';
@@ -103,7 +122,8 @@
if ($gen_app) {
for ( qw/ _mk_dirs _mk_config _mk_appclass _mk_rootclass _mk_readme
- _mk_changes _mk_apptest _mk_images _mk_favicon/ ) {
+ _mk_changes _mk_apptest _mk_podtest _mk_podcoveragetest
+ _mk_images _mk_favicon/ ) {
$self->$_;
}
@@ -405,7 +425,17 @@
my $self = shift;
my $t = $self->{t};
$self->render_sharedir_file( file('t', '01app.t.tt'), file($t, "01app.t") );
+}
+
+sub _mk_podtest {
+ my $self = shift;
+ my $t = $self->{t};
$self->render_sharedir_file( file('t', '02pod.t.tt'), file($t, "02pod.t") );
+}
+
+sub _mk_podcoveragetest {
+ my $self = shift;
+ my $t = $self->{t};
$self->render_sharedir_file( file('t', '03podcoverage.t.tt'), file($t, "03podcoverage.t") );
}
Modified: trunk/libcatalyst-devel-perl/lib/Module/Install/Catalyst.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-devel-perl/lib/Module/Install/Catalyst.pm?rev=67924&op=diff
==============================================================================
--- trunk/libcatalyst-devel-perl/lib/Module/Install/Catalyst.pm (original)
+++ trunk/libcatalyst-devel-perl/lib/Module/Install/Catalyst.pm Thu Jan 27 12:08:59 2011
@@ -8,9 +8,9 @@
use File::Find;
use FindBin;
-use File::Copy::Recursive 'rcopy';
+use File::Copy::Recursive;
use File::Spec ();
-use Getopt::Long qw(GetOptionsFromString :config no_ignore_case);
+use Getopt::Long ();
use Data::Dumper;
my $SAFETY = 0;
@@ -58,6 +58,14 @@
sub catalyst {
my $self = shift;
+
+ if($Module::Install::AUTHOR) {
+ $self->admin->copy_package(
+ 'File::Copy::Recursive',
+ $INC{"File/Copy/Recursive.pm"},
+ );
+ }
+
print <<EOF;
*** Module::Install::Catalyst
EOF
@@ -94,7 +102,7 @@
my @path = split '-', $self->name;
for my $orig (@files) {
my $path = File::Spec->catdir( 'blib', 'lib', @path, $orig );
- rcopy( $orig, $path );
+ File::Copy::Recursive::rcopy( $orig, $path );
}
}
@@ -214,13 +222,18 @@
sub catalyst_par_options {
my ( $self, $optstring ) = @_;
- my %o = ();
eval "use PAR::Packer ()";
if ($@) {
warn "WARNING: catalyst_par_options ignored - you need PAR::Packer\n"
}
else {
- GetOptionsFromString($optstring, \%o, PAR::Packer->options);
+ my $p = Getopt::Long::Parser->new(config => ['no_ignore_case']);
+ my %o;
+ require Text::ParseWords;
+ {
+ local @ARGV = Text::ParseWords::shellwords($optstring);
+ $p->getoptions(\%o, PAR::Packer->options);
+ }
%PAROPTS = ( %PAROPTS, %o);
}
}
Modified: trunk/libcatalyst-devel-perl/share/lib/MyApp.pm.tt
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-devel-perl/share/lib/MyApp.pm.tt?rev=67924&op=diff
==============================================================================
--- trunk/libcatalyst-devel-perl/share/lib/MyApp.pm.tt (original)
+++ trunk/libcatalyst-devel-perl/share/lib/MyApp.pm.tt Thu Jan 27 12:08:59 2011
@@ -4,7 +4,11 @@
use Catalyst::Runtime 5.80;
-# Set flags and add plugins for the application
+# Set flags and add plugins for the application.
+#
+# Note that ORDERING IS IMPORTANT here as plugins are initialized in order,
+# therefore you almost certainly want to keep ConfigLoader at the head of the
+# list if you're using it.
#
# -Debug: activates the debug mode for very useful log messages
# ConfigLoader: will load the configuration from a Config::General file in the
@@ -21,7 +25,6 @@
extends 'Catalyst';
our $VERSION = '0.01';
-$VERSION = eval $VERSION;
# Configure the application.
#
Modified: trunk/libcatalyst-devel-perl/share/script/myapp_fastcgi.pl.tt
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-devel-perl/share/script/myapp_fastcgi.pl.tt?rev=67924&op=diff
==============================================================================
--- trunk/libcatalyst-devel-perl/share/script/myapp_fastcgi.pl.tt (original)
+++ trunk/libcatalyst-devel-perl/share/script/myapp_fastcgi.pl.tt Thu Jan 27 12:08:59 2011
@@ -30,6 +30,7 @@
or empty string to disable
-e --keeperr send error messages to STDOUT, not
to the webserver
+ --proc_title Set the process title (is possible)
=head1 DESCRIPTION
Modified: trunk/libcatalyst-devel-perl/share/script/myapp_server.pl.tt
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-devel-perl/share/script/myapp_server.pl.tt?rev=67924&op=diff
==============================================================================
--- trunk/libcatalyst-devel-perl/share/script/myapp_server.pl.tt (original)
+++ trunk/libcatalyst-devel-perl/share/script/myapp_server.pl.tt Thu Jan 27 12:08:59 2011
@@ -32,7 +32,7 @@
a restart when modified
(defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
--restart_directory the directory to search for
- modified files, can be set mulitple times
+ modified files, can be set multiple times
(defaults to '[SCRIPT_DIR]/..')
--follow_symlinks follow symlinks in search directories
(defaults to false. this is a no-op on Win32)
Modified: trunk/libcatalyst-devel-perl/share/t/01app.t.tt
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-devel-perl/share/t/01app.t.tt?rev=67924&op=diff
==============================================================================
--- trunk/libcatalyst-devel-perl/share/t/01app.t.tt (original)
+++ trunk/libcatalyst-devel-perl/share/t/01app.t.tt Thu Jan 27 12:08:59 2011
@@ -3,7 +3,7 @@
use warnings;
use Test::More;
-BEGIN { use_ok 'Catalyst::Test', '[% name %]' }
+use Catalyst::Test '[% name %]';
ok( request('/')->is_success, 'Request should succeed' );
Modified: trunk/libcatalyst-devel-perl/share/t/comptest.tt
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-devel-perl/share/t/comptest.tt?rev=67924&op=diff
==============================================================================
--- trunk/libcatalyst-devel-perl/share/t/comptest.tt (original)
+++ trunk/libcatalyst-devel-perl/share/t/comptest.tt Thu Jan 27 12:08:59 2011
@@ -1,9 +1,9 @@
use strict;
use warnings;
-[% IF long_type == 'Controller' %][% IF mech %]use Test::More;
+use Test::More;
+[% IF long_type == 'Controller' %][% IF mech %]
-eval "use Test::WWW::Mechanize::Catalyst '[% name %]'";
-if ($@) {
+unless (eval q{use Test::WWW::Mechanize::Catalyst '[% name %]'; 1}) {
plan skip_all => 'Test::WWW::Mechanize::Catalyst required';
exit 0;
}
@@ -11,10 +11,10 @@
ok( my $mech = Test::WWW::Mechanize::Catalyst->new, 'Created mech object' );
$mech->get_ok( 'http://localhost[% uri %]' );
-[%- ELSE %]use Test::More;
+[%- ELSE %]
-BEGIN { use_ok 'Catalyst::Test', '[% app %]' }
-BEGIN { use_ok '[% class %]' }
+use Catalyst::Test '[% app %]';
+use [% class %];
ok( request('[% uri %]')->is_success, 'Request should succeed' );
[%- END -%]
Modified: trunk/libcatalyst-devel-perl/t/generated_app.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-devel-perl/t/generated_app.t?rev=67924&op=diff
==============================================================================
--- trunk/libcatalyst-devel-perl/t/generated_app.t (original)
+++ trunk/libcatalyst-devel-perl/t/generated_app.t Thu Jan 27 12:08:59 2011
@@ -18,6 +18,14 @@
unless -d $share_dir;
$ENV{CATALYST_DEVEL_SHAREDIR} = $share_dir;
+my $instdir = tempdir(CLEANUP => 1);
+
+$ENV{PERL_MM_OPT} = "INSTALL_BASE=$instdir";
+$ENV{INSTALL_BASE} = $instdir;
+if ($ENV{MAKEFLAGS}) {
+ $ENV{MAKEFLAGS} =~ s/PREFIX=[^\s]+//;
+ $ENV{MAKEFLAGS} =~ s/INSTALL_BASE=[^\s]+//;
+}
my $dir = tempdir(CLEANUP => 1);
my $devnull = File::Spec->devnull;
@@ -72,7 +80,7 @@
script/testapp_create.pl
|;
-foreach my $fn (map { File::Spec->catdir(@$_) } map { [ split /\// ] } @files) {
+foreach my $fn (map { File::Spec->catdir(@$_) } map { [ File::Spec::Unix->splitdir($_) ] } @files) {
test_fn($fn);
}
create_ok($_, 'My' . $_) for qw/Model View Controller/;
@@ -84,8 +92,9 @@
run_generated_component_tests();
+my $server_script_file = File::Spec->catdir(qw/script testapp_server.pl/);
my $server_script = do {
- open(my $fh, '<', File::Spec->catdir(qw/script testapp_server.pl/)) or fail $!;
+ open(my $fh, '<', $server_script_file) or fail $!;
local $/;
<$fh>;
};
@@ -94,6 +103,61 @@
ok $server_script =~ qr/CATALYST_SCRIPT_GEN}\s+=\s+(\d+)/,
'SCRIPT_GEN found in generated output';
is $1, $Catalyst::Devel::CATALYST_SCRIPT_GEN, 'Script gen correct';
+
+{
+ open(my $fh, '>', $server_script_file) or fail $!;
+ print $fh "MOO\n";
+}
+my $helper = Catalyst::Helper->new(
+ {
+ '.newfiles' => 0,
+ 'makefile' => 0,
+ 'scripts' => 1,
+ name => '.',
+ }
+);
+$helper->mk_app( '.' ) or fail;
+
+my $server_script_new = do {
+ open(my $fh, '<', $server_script_file) or fail $!;
+ local $/;
+ <$fh>;
+};
+
+is $server_script, $server_script_new;
+
+diag "Installed app is in $instdir";
+command_ok( [ ($Config{make} || 'make', 'install') ] );
+
+my $inst_app_dir = File::Spec->catdir($instdir);
+chdir($inst_app_dir) or die "Cannot chdir to $inst_app_dir: $!";
+lib->import(File::Spec->catdir($instdir, 'lib', 'perl5'));
+
+my @installed_files = qw|
+ lib/perl5/TestApp.pm
+ lib/perl5/TestApp/testapp.conf
+ lib/perl5/TestApp/Controller/Root.pm
+ lib/perl5/TestApp/root/static/images/catalyst_logo.png
+ lib/perl5/TestApp/root/static/images/btn_120x50_built.png
+ lib/perl5/TestApp/root/static/images/btn_120x50_built_shadow.png
+ lib/perl5/TestApp/root/static/images/btn_120x50_powered.png
+ lib/perl5/TestApp/root/static/images/btn_120x50_powered_shadow.png
+ lib/perl5/TestApp/root/static/images/btn_88x31_built.png
+ lib/perl5/TestApp/root/static/images/btn_88x31_built_shadow.png
+ lib/perl5/TestApp/root/static/images/btn_88x31_powered.png
+ lib/perl5/TestApp/root/static/images/btn_88x31_powered_shadow.png
+ lib/perl5/TestApp/root/favicon.ico
+ bin/testapp_cgi.pl
+ bin/testapp_fastcgi.pl
+ bin/testapp_server.pl
+ bin/testapp_test.pl
+ bin/testapp_create.pl
+|;
+
+foreach my $fn (map { File::Spec->catdir(@$_) } map { [ File::Spec::Unix->splitdir($_) ] } @installed_files) {
+ my $ffn = File::Spec->catfile($inst_app_dir, $fn);
+ ok -r $ffn, "'$fn' installed in correct location";
+}
chdir('/');
done_testing;
More information about the Pkg-perl-cvs-commits
mailing list