r67922 - in /branches/upstream/libcatalyst-devel-perl/current: ./ 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 11:58:12 UTC 2011
Author: ansgar
Date: Thu Jan 27 11:57:56 2011
New Revision: 67922
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=67922
Log:
[svn-upgrade] new version libcatalyst-devel-perl (1.31)
Added:
branches/upstream/libcatalyst-devel-perl/current/inc/Module/Install/AuthorTests.pm
branches/upstream/libcatalyst-devel-perl/current/t/author/
branches/upstream/libcatalyst-devel-perl/current/t/author/pod.t
branches/upstream/libcatalyst-devel-perl/current/t/author/podcoverage.t
branches/upstream/libcatalyst-devel-perl/current/t/author/version_numbers.t
Removed:
branches/upstream/libcatalyst-devel-perl/current/t/02pod.t
branches/upstream/libcatalyst-devel-perl/current/t/03podcoverage.t
branches/upstream/libcatalyst-devel-perl/current/xt/
Modified:
branches/upstream/libcatalyst-devel-perl/current/Changes
branches/upstream/libcatalyst-devel-perl/current/MANIFEST
branches/upstream/libcatalyst-devel-perl/current/META.yml
branches/upstream/libcatalyst-devel-perl/current/Makefile.PL
branches/upstream/libcatalyst-devel-perl/current/lib/Catalyst/Devel.pm
branches/upstream/libcatalyst-devel-perl/current/lib/Catalyst/Helper.pm
branches/upstream/libcatalyst-devel-perl/current/lib/Module/Install/Catalyst.pm
branches/upstream/libcatalyst-devel-perl/current/share/lib/MyApp.pm.tt
branches/upstream/libcatalyst-devel-perl/current/share/script/myapp_fastcgi.pl.tt
branches/upstream/libcatalyst-devel-perl/current/share/script/myapp_server.pl.tt
branches/upstream/libcatalyst-devel-perl/current/share/t/01app.t.tt
branches/upstream/libcatalyst-devel-perl/current/share/t/comptest.tt
branches/upstream/libcatalyst-devel-perl/current/t/generated_app.t
Modified: branches/upstream/libcatalyst-devel-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/Changes?rev=67922&op=diff
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/Changes (original)
+++ branches/upstream/libcatalyst-devel-perl/current/Changes Thu Jan 27 11:57:56 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: branches/upstream/libcatalyst-devel-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/MANIFEST?rev=67922&op=diff
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/MANIFEST (original)
+++ branches/upstream/libcatalyst-devel-perl/current/MANIFEST Thu Jan 27 11:57:56 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: branches/upstream/libcatalyst-devel-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/META.yml?rev=67922&op=diff
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/META.yml (original)
+++ branches/upstream/libcatalyst-devel-perl/current/META.yml Thu Jan 27 11:57:56 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: branches/upstream/libcatalyst-devel-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/Makefile.PL?rev=67922&op=diff
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/Makefile.PL (original)
+++ branches/upstream/libcatalyst-devel-perl/current/Makefile.PL Thu Jan 27 11:57:56 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
Added: branches/upstream/libcatalyst-devel-perl/current/inc/Module/Install/AuthorTests.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/inc/Module/Install/AuthorTests.pm?rev=67922&op=file
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/inc/Module/Install/AuthorTests.pm (added)
+++ branches/upstream/libcatalyst-devel-perl/current/inc/Module/Install/AuthorTests.pm Thu Jan 27 11:57:56 2011
@@ -1,0 +1,59 @@
+#line 1
+package Module::Install::AuthorTests;
+
+use 5.005;
+use strict;
+use Module::Install::Base;
+use Carp ();
+
+#line 16
+
+use vars qw{$VERSION $ISCORE @ISA};
+BEGIN {
+ $VERSION = '0.002';
+ $ISCORE = 1;
+ @ISA = qw{Module::Install::Base};
+}
+
+#line 42
+
+sub author_tests {
+ my ($self, @dirs) = @_;
+ _add_author_tests($self, \@dirs, 0);
+}
+
+#line 56
+
+sub recursive_author_tests {
+ my ($self, @dirs) = @_;
+ _add_author_tests($self, \@dirs, 1);
+}
+
+sub _wanted {
+ my $href = shift;
+ sub { /\.t$/ and -f $_ and $href->{$File::Find::dir} = 1 }
+}
+
+sub _add_author_tests {
+ my ($self, $dirs, $recurse) = @_;
+ return unless $Module::Install::AUTHOR;
+
+ my @tests = $self->tests ? (split / /, $self->tests) : 't/*.t';
+
+ # XXX: pick a default, later -- rjbs, 2008-02-24
+ my @dirs = @$dirs ? @$dirs : Carp::confess "no dirs given to author_tests";
+ @dirs = grep { -d } @dirs;
+
+ if ($recurse) {
+ require File::Find;
+ my %test_dir;
+ File::Find::find(_wanted(\%test_dir), @dirs);
+ $self->tests( join ' ', @tests, map { "$_/*.t" } sort keys %test_dir );
+ } else {
+ $self->tests( join ' ', @tests, map { "$_/*.t" } sort @dirs );
+ }
+}
+
+#line 107
+
+1;
Modified: branches/upstream/libcatalyst-devel-perl/current/lib/Catalyst/Devel.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/lib/Catalyst/Devel.pm?rev=67922&op=diff
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/lib/Catalyst/Devel.pm (original)
+++ branches/upstream/libcatalyst-devel-perl/current/lib/Catalyst/Devel.pm Thu Jan 27 11:57:56 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: branches/upstream/libcatalyst-devel-perl/current/lib/Catalyst/Helper.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/lib/Catalyst/Helper.pm?rev=67922&op=diff
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/lib/Catalyst/Helper.pm (original)
+++ branches/upstream/libcatalyst-devel-perl/current/lib/Catalyst/Helper.pm Thu Jan 27 11:57:56 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: branches/upstream/libcatalyst-devel-perl/current/lib/Module/Install/Catalyst.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/lib/Module/Install/Catalyst.pm?rev=67922&op=diff
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/lib/Module/Install/Catalyst.pm (original)
+++ branches/upstream/libcatalyst-devel-perl/current/lib/Module/Install/Catalyst.pm Thu Jan 27 11:57:56 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: branches/upstream/libcatalyst-devel-perl/current/share/lib/MyApp.pm.tt
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/share/lib/MyApp.pm.tt?rev=67922&op=diff
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/share/lib/MyApp.pm.tt (original)
+++ branches/upstream/libcatalyst-devel-perl/current/share/lib/MyApp.pm.tt Thu Jan 27 11:57:56 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: branches/upstream/libcatalyst-devel-perl/current/share/script/myapp_fastcgi.pl.tt
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/share/script/myapp_fastcgi.pl.tt?rev=67922&op=diff
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/share/script/myapp_fastcgi.pl.tt (original)
+++ branches/upstream/libcatalyst-devel-perl/current/share/script/myapp_fastcgi.pl.tt Thu Jan 27 11:57:56 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: branches/upstream/libcatalyst-devel-perl/current/share/script/myapp_server.pl.tt
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/share/script/myapp_server.pl.tt?rev=67922&op=diff
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/share/script/myapp_server.pl.tt (original)
+++ branches/upstream/libcatalyst-devel-perl/current/share/script/myapp_server.pl.tt Thu Jan 27 11:57:56 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: branches/upstream/libcatalyst-devel-perl/current/share/t/01app.t.tt
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/share/t/01app.t.tt?rev=67922&op=diff
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/share/t/01app.t.tt (original)
+++ branches/upstream/libcatalyst-devel-perl/current/share/t/01app.t.tt Thu Jan 27 11:57:56 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: branches/upstream/libcatalyst-devel-perl/current/share/t/comptest.tt
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/share/t/comptest.tt?rev=67922&op=diff
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/share/t/comptest.tt (original)
+++ branches/upstream/libcatalyst-devel-perl/current/share/t/comptest.tt Thu Jan 27 11:57:56 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 -%]
Added: branches/upstream/libcatalyst-devel-perl/current/t/author/pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/t/author/pod.t?rev=67922&op=file
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/t/author/pod.t (added)
+++ branches/upstream/libcatalyst-devel-perl/current/t/author/pod.t Thu Jan 27 11:57:56 2011
@@ -1,0 +1,5 @@
+use Test::More 0.88;
+use Test::Pod 1.14;
+
+all_pod_files_ok();
+
Added: branches/upstream/libcatalyst-devel-perl/current/t/author/podcoverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/t/author/podcoverage.t?rev=67922&op=file
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/t/author/podcoverage.t (added)
+++ branches/upstream/libcatalyst-devel-perl/current/t/author/podcoverage.t Thu Jan 27 11:57:56 2011
@@ -1,0 +1,8 @@
+use strict;
+use warnings;
+use Test::More;
+use Test::Pod::Coverage 1.04;
+use Pod::Coverage 0.20;
+
+all_pod_coverage_ok( { trustme => [ qr/^(?:BUILD|DEMOLISH)$/ ] } );
+
Added: branches/upstream/libcatalyst-devel-perl/current/t/author/version_numbers.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/t/author/version_numbers.t?rev=67922&op=file
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/t/author/version_numbers.t (added)
+++ branches/upstream/libcatalyst-devel-perl/current/t/author/version_numbers.t Thu Jan 27 11:57:56 2011
@@ -1,0 +1,32 @@
+use strict;
+use warnings;
+
+use FindBin qw/$Bin/;
+use File::Spec;
+use File::Find::Rule;
+use Module::Info;
+
+use Test::More;
+
+my %versions;
+for my $pm_file ( File::Find::Rule->file->name( qr/\.pm$/ )->in(File::Spec->catdir($Bin, '..', '..', 'lib') ) ) {
+ my $mod = Module::Info->new_from_file($pm_file);
+
+ ( my $stripped_file = $pm_file ) =~ s{.*lib/}{};
+
+ $versions{$stripped_file} = $mod->version;
+}
+
+my $ver = delete $versions{'Catalyst/Devel.pm'};
+ok $ver;
+ok scalar(keys %versions);
+
+for my $module ( sort keys %versions ) {
+ next unless $versions{$module};
+
+ is( $versions{$module}, $ver,
+ "version for $module is the same as in Catalyst/Devel.pm" );
+}
+
+done_testing;
+
Modified: branches/upstream/libcatalyst-devel-perl/current/t/generated_app.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-devel-perl/current/t/generated_app.t?rev=67922&op=diff
==============================================================================
--- branches/upstream/libcatalyst-devel-perl/current/t/generated_app.t (original)
+++ branches/upstream/libcatalyst-devel-perl/current/t/generated_app.t Thu Jan 27 11:57:56 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