Merge branch 'master' into psgi
Florian Ragwitz [Tue, 1 Mar 2011 18:38:45 +0000 (19:38 +0100)]
* master:
  Use ensure_class_loaded, less ugly
  Make all Restarter subclasses immutable
  Version 0.31
  Make pod tests author only
  Fix the test in dist build
  fixed config and template files not getting installed
  added test for checking installed files
  Add built dists to MANIFEST.SKIP
  Version 1.30 after pulling master, duh
  Version 1.29
  Document --proc_title in generated fcgi script
  Not so much use_ok
  Explain why we depend on Module::Install

1  2 
lib/Catalyst/Helper.pm
t/generated_app.t

diff --combined lib/Catalyst/Helper.pm
@@@ -19,7 -19,7 +19,7 @@@ use namespace::autoclean
  with 'MooseX::Emulate::Class::Accessor::Fast';
  
  # Change Catalyst/Devel.pm also
- our $VERSION = '1.28';
+ our $VERSION = '1.31';
  
  my %cache;
  
@@@ -121,9 -121,10 +121,9 @@@ sub mk_app 
      my $gen_app = ( $self->{scripts} || $self->{makefile} ) ? 0 : 1;
  
      if ($gen_app) {
 -        for ( qw/ _mk_dirs _mk_config _mk_appclass _mk_rootclass _mk_readme
 -              _mk_changes _mk_apptest _mk_podtest _mk_podcoveragetest
 +        for ( qw/ _mk_dirs _mk_config _mk_psgi _mk_appclass _mk_rootclass
 +              _mk_readme _mk_changes _mk_apptest _mk_podtest _mk_podcoveragetest
                _mk_images _mk_favicon/ ) {
 -            
              $self->$_;
          }
      }
          $self->_mk_makefile;
      }
      if ($gen_scripts) {
 -        for ( qw/ _mk_cgi _mk_fastcgi _mk_server 
 +        for ( qw/ _mk_cgi _mk_fastcgi _mk_server
                    _mk_test _mk_create _mk_information
          / ) {
                $self->$_;
      return $self->{dir};
  }
  
 -## not much of this can really be changed, mk_compclass must be left for 
 +## not much of this can really be changed, mk_compclass must be left for
  ## backcompat
  sub mk_component {
      my $self = shift;
@@@ -399,14 -400,6 +399,14 @@@ sub _mk_makefile 
      }
  }
  
 +sub _mk_psgi {
 +    my $self      = shift;
 +    my $dir       = $self->{dir};
 +    my $appprefix = $self->{appprefix};
 +    $self->render_sharedir_file( 'myapp.psgi.tt',
 +        file( $dir, "$appprefix.psgi" ) );
 +}
 +
  sub _mk_config {
      my $self      = shift;
      my $dir       = $self->{dir};
diff --combined t/generated_app.t
@@@ -18,6 -18,14 +18,14 @@@ plan skip_all => "No share dir at $shar
      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;
@@@ -47,7 -55,6 +55,7 @@@ lib->import(File::Spec->catdir($dir, 'T
  my @files = qw|
      Makefile.PL
      testapp.conf
 +    testapp.psgi
      lib/TestApp.pm
      lib/TestApp/Controller/Root.pm
      README
@@@ -73,7 -80,7 +81,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/;
@@@ -119,6 -126,39 +127,39 @@@ my $server_script_new = do 
  
  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;