r60821 - in /trunk/libcatalyst-perl: ./ debian/ inc/Module/ inc/Module/Install/ lib/ lib/Catalyst/ lib/Catalyst/Engine/ lib/Catalyst/Script/ t/ t/aggregate/ t/lib/ t/lib/TestApp/Controller/Moose/
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Thu Jul 29 06:34:27 UTC 2010
Author: ansgar-guest
Date: Thu Jul 29 06:34:12 2010
New Revision: 60821
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=60821
Log:
* New upstream release.
* debian/copyright: Refer to /usr/share/common-licenses/GPL-1.
* Bump Standards-Version to 3.9.1.
Added:
trunk/libcatalyst-perl/t/aggregate/unit_core_ctx_attr.t
- copied unchanged from r60818, branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_ctx_attr.t
trunk/libcatalyst-perl/t/lib/TestApp/Controller/Moose/NoAttributes.pm
- copied unchanged from r60818, branches/upstream/libcatalyst-perl/current/t/lib/TestApp/Controller/Moose/NoAttributes.pm
trunk/libcatalyst-perl/t/unit_core_methodattributes_method_metaclass_on_subclasses.t
- copied unchanged from r60818, branches/upstream/libcatalyst-perl/current/t/unit_core_methodattributes_method_metaclass_on_subclasses.t
Modified:
trunk/libcatalyst-perl/Changes
trunk/libcatalyst-perl/MANIFEST
trunk/libcatalyst-perl/META.yml
trunk/libcatalyst-perl/debian/changelog
trunk/libcatalyst-perl/debian/control
trunk/libcatalyst-perl/debian/copyright
trunk/libcatalyst-perl/inc/Module/Install.pm
trunk/libcatalyst-perl/inc/Module/Install/AutoInstall.pm
trunk/libcatalyst-perl/inc/Module/Install/Base.pm
trunk/libcatalyst-perl/inc/Module/Install/Can.pm
trunk/libcatalyst-perl/inc/Module/Install/Fetch.pm
trunk/libcatalyst-perl/inc/Module/Install/Include.pm
trunk/libcatalyst-perl/inc/Module/Install/Makefile.pm
trunk/libcatalyst-perl/inc/Module/Install/Metadata.pm
trunk/libcatalyst-perl/inc/Module/Install/Scripts.pm
trunk/libcatalyst-perl/inc/Module/Install/Win32.pm
trunk/libcatalyst-perl/inc/Module/Install/WriteAll.pm
trunk/libcatalyst-perl/lib/Catalyst.pm
trunk/libcatalyst-perl/lib/Catalyst/Component.pm
trunk/libcatalyst-perl/lib/Catalyst/Controller.pm
trunk/libcatalyst-perl/lib/Catalyst/Engine.pm
trunk/libcatalyst-perl/lib/Catalyst/Engine/CGI.pm
trunk/libcatalyst-perl/lib/Catalyst/Runtime.pm
trunk/libcatalyst-perl/lib/Catalyst/Script/Create.pm
trunk/libcatalyst-perl/lib/Catalyst/Script/Server.pm
trunk/libcatalyst-perl/t/aggregate/unit_core_engine_cgi-prepare_path.t
trunk/libcatalyst-perl/t/lib/TestApp.pm
Modified: trunk/libcatalyst-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/Changes?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/Changes (original)
+++ trunk/libcatalyst-perl/Changes Thu Jul 29 06:34:12 2010
@@ -1,4 +1,26 @@
# This file documents the revision history for Perl extension Catalyst.
+
+5.80025 2010-07-29 01:50:00
+
+ New features:
+ - An 'action_class' method has been added to Catalyst::Controller to
+ allow controller base classes, roles or traits
+ (e.g. Catalyst::Controller::ActionRole) to more easily override
+ the default action creation.
+
+ Bug fixes:
+ - Fix the --mech and --mechanize options to the myapp_create.pl script
+ to operate correctly by fixing the options passed down into the script.
+ - Fix controllers with no method attributes (where the action definitions
+ are entirely contained in config). RT#58057
+ - Fix running as a CGI under IIS at non-root locations.
+
+ Documentation:
+ - Fix missing - in the docs when describing the --mechanize option at one
+ point.
+ - Explained the common practice how to access the component's config
+ values.
+ - Fixed typo in Catalyst/Script/Server.pm (RT #58474)
5.80024 2010-05-15 11:55:44
Modified: trunk/libcatalyst-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/MANIFEST?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/MANIFEST (original)
+++ trunk/libcatalyst-perl/MANIFEST Thu Jul 29 06:34:12 2010
@@ -137,6 +137,7 @@
t/aggregate/unit_core_component_layers.t
t/aggregate/unit_core_component_loading.t
t/aggregate/unit_core_component_mro.t
+t/aggregate/unit_core_ctx_attr.t
t/aggregate/unit_core_engine_cgi-prepare_path.t
t/aggregate/unit_core_engine_fixenv-iis6.t
t/aggregate/unit_core_engine_fixenv-lighttpd.t
@@ -268,6 +269,7 @@
t/lib/TestApp/Controller/Keyword.pm
t/lib/TestApp/Controller/Moose.pm
t/lib/TestApp/Controller/Moose/MethodModifiers.pm
+t/lib/TestApp/Controller/Moose/NoAttributes.pm
t/lib/TestApp/Controller/Priorities.pm
t/lib/TestApp/Controller/Priorities/loc_vs_index.pm
t/lib/TestApp/Controller/Priorities/locre_vs_index.pm
@@ -348,6 +350,7 @@
t/plugin_new_method_backcompat.t
t/something/Makefile.PL
t/something/script/foo/bar/for_dist
+t/unit_core_methodattributes_method_metaclass_on_subclasses.t
t/unit_stats.t
t/unit_utils_load_class.t
t/unit_utils_subdir.t
Modified: trunk/libcatalyst-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/META.yml?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/META.yml (original)
+++ trunk/libcatalyst-perl/META.yml Thu Jul 29 06:34:12 2010
@@ -10,7 +10,7 @@
configure_requires:
ExtUtils::MakeMaker: 6.42
distribution_type: module
-generated_by: 'Module::Install version 0.97'
+generated_by: 'Module::Install version 0.99'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -68,4 +68,4 @@
homepage: http://dev.catalyst.perl.org/
license: http://dev.perl.org/licenses/
repository: http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Runtime/
-version: 5.80024
+version: 5.80025
Modified: trunk/libcatalyst-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/debian/changelog?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/debian/changelog (original)
+++ trunk/libcatalyst-perl/debian/changelog Thu Jul 29 06:34:12 2010
@@ -1,3 +1,11 @@
+libcatalyst-perl (5.80025-1) unstable; urgency=low
+
+ * New upstream release.
+ * debian/copyright: Refer to /usr/share/common-licenses/GPL-1.
+ * Bump Standards-Version to 3.9.1.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org> Thu, 29 Jul 2010 15:32:25 +0900
+
libcatalyst-perl (5.80024-1) unstable; urgency=low
[ Jonathan Yu ]
Modified: trunk/libcatalyst-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/debian/control?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/debian/control (original)
+++ trunk/libcatalyst-perl/debian/control Thu Jul 29 06:34:12 2010
@@ -22,7 +22,7 @@
Uploaders: Krzysztof Krzyżaniak (eloy) <eloy at debian.org>,
gregor herrmann <gregoa at debian.org>, Jonathan Yu <jawnsy at cpan.org>,
Franck Joncourt <franck at debian.org>, Ansgar Burchardt <ansgar at 43-1.org>
-Standards-Version: 3.8.4
+Standards-Version: 3.9.1
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libcatalyst-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libcatalyst-perl/
Homepage: http://search.cpan.org/dist/Catalyst-Runtime/
Modified: trunk/libcatalyst-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/debian/copyright?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/debian/copyright (original)
+++ trunk/libcatalyst-perl/debian/copyright Thu Jul 29 06:34:12 2010
@@ -3,7 +3,6 @@
Source: http://search.cpan.org/dist/Catalyst-Runtime/
Name: Catalyst-Runtime
-Files: *
Copyright: 2005-2010, Sebastian Riedel <sri at cpan.org>, Catalyst Core Team
License: Artistic or GPL-1+
@@ -27,7 +26,7 @@
it under the terms of the Artistic License, which comes with Perl.
.
On Debian GNU/Linux systems, the complete text of the Artistic License
- can be found in `/usr/share/common-licenses/Artistic'
+ can be found in `/usr/share/common-licenses/Artistic'.
License: GPL-1+
This program is free software; you can redistribute it and/or modify
@@ -35,5 +34,5 @@
the Free Software Foundation; either version 1, or (at your option)
any later version.
.
- On Debian GNU/Linux systems, the complete text of the GNU General
- Public License can be found in `/usr/share/common-licenses/GPL'
+ On Debian GNU/Linux systems, the complete text of version 1 of the GNU
+ General Public License can be found in `/usr/share/common-licenses/GPL-1'.
Modified: trunk/libcatalyst-perl/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/inc/Module/Install.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/inc/Module/Install.pm (original)
+++ trunk/libcatalyst-perl/inc/Module/Install.pm Thu Jul 29 06:34:12 2010
@@ -22,7 +22,6 @@
use Cwd ();
use File::Find ();
use File::Path ();
-use FindBin;
use vars qw{$VERSION $MAIN};
BEGIN {
@@ -32,7 +31,7 @@
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '0.97';
+ $VERSION = '0.99';
# Storage for the pseudo-singleton
$MAIN = undef;
@@ -231,7 +230,8 @@
sub new {
my ($class, %args) = @_;
- FindBin->again;
+ delete $INC{'FindBin.pm'};
+ require FindBin;
# ignore the prefix on extension modules built from top level.
my $base_path = Cwd::abs_path($FindBin::Bin);
Modified: trunk/libcatalyst-perl/inc/Module/Install/AutoInstall.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/inc/Module/Install/AutoInstall.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/inc/Module/Install/AutoInstall.pm (original)
+++ trunk/libcatalyst-perl/inc/Module/Install/AutoInstall.pm Thu Jul 29 06:34:12 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: trunk/libcatalyst-perl/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/inc/Module/Install/Base.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/inc/Module/Install/Base.pm (original)
+++ trunk/libcatalyst-perl/inc/Module/Install/Base.pm Thu Jul 29 06:34:12 2010
@@ -4,7 +4,7 @@
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
}
# Suspend handler for "redefined" warnings
Modified: trunk/libcatalyst-perl/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/inc/Module/Install/Can.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/inc/Module/Install/Can.pm (original)
+++ trunk/libcatalyst-perl/inc/Module/Install/Can.pm Thu Jul 29 06:34:12 2010
@@ -9,7 +9,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: trunk/libcatalyst-perl/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/inc/Module/Install/Fetch.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/inc/Module/Install/Fetch.pm (original)
+++ trunk/libcatalyst-perl/inc/Module/Install/Fetch.pm Thu Jul 29 06:34:12 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: trunk/libcatalyst-perl/inc/Module/Install/Include.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/inc/Module/Install/Include.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/inc/Module/Install/Include.pm (original)
+++ trunk/libcatalyst-perl/inc/Module/Install/Include.pm Thu Jul 29 06:34:12 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: trunk/libcatalyst-perl/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/inc/Module/Install/Makefile.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/inc/Module/Install/Makefile.pm (original)
+++ trunk/libcatalyst-perl/inc/Module/Install/Makefile.pm Thu Jul 29 06:34:12 2010
@@ -4,10 +4,11 @@
use strict 'vars';
use ExtUtils::MakeMaker ();
use Module::Install::Base ();
+use Fcntl qw/:flock :seek/;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -364,9 +365,9 @@
. ($self->postamble || '');
local *MAKEFILE;
- open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+ open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+ eval { flock MAKEFILE, LOCK_EX };
my $makefile = do { local $/; <MAKEFILE> };
- close MAKEFILE or die $!;
$makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
$makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
@@ -386,7 +387,8 @@
# XXX - This is currently unused; not sure if it breaks other MM-users
# $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
- open MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+ seek MAKEFILE, 0, SEEK_SET;
+ truncate MAKEFILE, 0;
print MAKEFILE "$preamble$makefile$postamble" or die $!;
close MAKEFILE or die $!;
@@ -410,4 +412,4 @@
__END__
-#line 539
+#line 541
Modified: trunk/libcatalyst-perl/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/inc/Module/Install/Metadata.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/inc/Module/Install/Metadata.pm (original)
+++ trunk/libcatalyst-perl/inc/Module/Install/Metadata.pm Thu Jul 29 06:34:12 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -616,8 +616,15 @@
return $v;
}
-
-
+sub add_metadata {
+ my $self = shift;
+ my %hash = @_;
+ for my $key (keys %hash) {
+ warn "add_metadata: $key is not prefixed with 'x_'.\n" .
+ "Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/;
+ $self->{values}->{$key} = $hash{$key};
+ }
+}
######################################################################
Modified: trunk/libcatalyst-perl/inc/Module/Install/Scripts.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/inc/Module/Install/Scripts.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/inc/Module/Install/Scripts.pm (original)
+++ trunk/libcatalyst-perl/inc/Module/Install/Scripts.pm Thu Jul 29 06:34:12 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: trunk/libcatalyst-perl/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/inc/Module/Install/Win32.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/inc/Module/Install/Win32.pm (original)
+++ trunk/libcatalyst-perl/inc/Module/Install/Win32.pm Thu Jul 29 06:34:12 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: trunk/libcatalyst-perl/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/inc/Module/Install/WriteAll.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/inc/Module/Install/WriteAll.pm (original)
+++ trunk/libcatalyst-perl/inc/Module/Install/WriteAll.pm Thu Jul 29 06:34:12 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';;
+ $VERSION = '0.99';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
Modified: trunk/libcatalyst-perl/lib/Catalyst.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/lib/Catalyst.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/lib/Catalyst.pm (original)
+++ trunk/libcatalyst-perl/lib/Catalyst.pm Thu Jul 29 06:34:12 2010
@@ -79,7 +79,7 @@
# Remember to update this in Catalyst::Runtime as well!
-our $VERSION = '5.80024';
+our $VERSION = '5.80025';
sub import {
my ( $class, @arguments ) = @_;
@@ -892,7 +892,7 @@
For example:
MyApp->config({ 'Model::Foo' => { bar => 'baz', overrides => 'me' } });
- MyApp::Model::Foo->config({ quux => 'frob', 'overrides => 'this' });
+ MyApp::Model::Foo->config({ quux => 'frob', overrides => 'this' });
will mean that C<MyApp::Model::Foo> receives the following data when
constructed:
@@ -902,6 +902,21 @@
quux => 'frob',
overrides => 'me',
});
+
+It's common practice to use a Moose attribute
+on the receiving component to access the config value.
+
+ package MyApp::Model::Foo;
+
+ use Moose;
+
+ # this attr will receive 'baz' at construction time
+ has 'bar' => (
+ is => 'rw',
+ isa => 'Str',
+ );
+
+You can then get the value 'baz' by calling $c->model('Foo')->bar
=cut
@@ -2406,10 +2421,6 @@
# we know M::P::O found a file on disk so this is safe
Catalyst::Utils::ensure_class_loaded( $component, { ignore_loaded => 1 } );
-
- # Needs to be done as soon as the component is loaded, as loading a sub-component
- # (next time round the loop) can cause us to get the wrong metaclass..
- $class->_controller_init_base_classes($component);
}
for my $component (@comps) {
@@ -2419,7 +2430,6 @@
: $class->expand_component_module( $component, $config );
for my $component (@expanded_components) {
next if $comps{$component};
- $class->_controller_init_base_classes($component); # Also cover inner packages
$class->components->{ $component } = $class->setup_component($component);
}
}
@@ -2471,19 +2481,6 @@
=head2 $c->setup_component
=cut
-
-# FIXME - Ugly, ugly hack to ensure the we force initialize non-moose base classes
-# nearest to Catalyst::Controller first, no matter what order stuff happens
-# to be loaded. There are TODO tests in Moose for this, see
-# f2391d17574eff81d911b97be15ea51080500003
-sub _controller_init_base_classes {
- my ($app_class, $component) = @_;
- return unless $component->isa('Catalyst::Controller');
- foreach my $class ( reverse @{ mro::get_linear_isa($component) } ) {
- Moose::Meta::Class->initialize( $class )
- unless find_meta($class);
- }
-}
sub setup_component {
my( $class, $component ) = @_;
@@ -3201,6 +3198,8 @@
Yuval Kogman, C<nothingmuch at woobling.org>
+rainboxx: Matthias Dietrich, C<perl at rainboxx.de>
+
=head1 LICENSE
This library is free software. You can redistribute it and/or modify it under
Modified: trunk/libcatalyst-perl/lib/Catalyst/Component.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/lib/Catalyst/Component.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/lib/Catalyst/Component.pm (original)
+++ trunk/libcatalyst-perl/lib/Catalyst/Component.pm Thu Jul 29 06:34:12 2010
@@ -170,7 +170,7 @@
C<< my $component_instance = $component->COMPONENT($app, $arguments); >>
-If this method is present (as it is on all Catalyst::Component subclasses,
+If this method is present (as it is on all Catalyst::Component subclasses),
it is called by Catalyst during setup_components with the application class
as $app and any config entry on the application for this component (for example,
in the case of MyApp::Controller::Foo this would be
@@ -185,7 +185,7 @@
sub COMPONENT {
my ($class, $app, $args) = @_;
- $args = $self->merge_config_hashes($self->config, $args);
+ $args = $class->merge_config_hashes($class->config, $args);
return $class->new($app, $args);
}
@@ -199,6 +199,12 @@
key value pair, or you can specify a hashref. In either case the keys
will be merged with any existing config settings. Each component in
a Catalyst application has its own config hash.
+
+The component's config hash is merged with any config entry on the
+application for this component and passed to C<new()> (as mentioned
+above at L</COMPONENT>). The common practice to access the merged
+config is to use a Moose attribute for each config entry on the
+receiving component.
=head2 $c->process()
Modified: trunk/libcatalyst-perl/lib/Catalyst/Controller.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/lib/Catalyst/Controller.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/lib/Catalyst/Controller.pm (original)
+++ trunk/libcatalyst-perl/lib/Catalyst/Controller.pm Thu Jul 29 06:34:12 2010
@@ -225,7 +225,9 @@
foreach my $method (@methods) {
my $name = $method->name;
- my $attributes = $method->attributes;
+ # Horrible hack! All method metaclasses should have an attributes
+ # method, core Moose bug - see r13354.
+ my $attributes = $method->can('attributes') ? $method->attributes : [];
my $attrs = $self->_parse_attrs( $c, $name, @{ $attributes } );
if ( $attrs->{Private} && ( keys %$attrs > 1 ) ) {
$c->log->debug( 'Bad action definition "'
@@ -248,16 +250,25 @@
}
}
+sub action_class {
+ my $self = shift;
+ my %args = @_;
+
+ my $class = (exists $args{attributes}{ActionClass}
+ ? $args{attributes}{ActionClass}[0]
+ : $self->_action_class);
+
+ Class::MOP::load_class($class);
+ return $class;
+}
+
sub create_action {
my $self = shift;
my %args = @_;
- my $class = (exists $args{attributes}{ActionClass}
- ? $args{attributes}{ActionClass}[0]
- : $self->_action_class);
- Class::MOP::load_class($class);
-
+ my $class = $self->action_class(%args);
my $action_args = $self->config->{action_args};
+
my %extra_args = (
%{ $action_args->{'*'} || {} },
%{ $action_args->{ $args{name} } || {} },
@@ -529,6 +540,11 @@
Creates action objects for a set of action methods using C< create_action >,
and registers them with the dispatcher.
+=head2 $self->action_class(%args)
+
+Used when a controller is creating an action to determine the correct base
+action class to use.
+
=head2 $self->create_action(%args)
Called with a hash of data to be use for construction of a new
Modified: trunk/libcatalyst-perl/lib/Catalyst/Engine.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/lib/Catalyst/Engine.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/lib/Catalyst/Engine.pm (original)
+++ trunk/libcatalyst-perl/lib/Catalyst/Engine.pm Thu Jul 29 06:34:12 2010
@@ -10,6 +10,8 @@
use HTTP::Body;
use HTTP::Headers;
use URI::QueryParam;
+use Encode ();
+use utf8;
use namespace::clean -except => 'meta';
@@ -131,6 +133,14 @@
$c->res->content_type('text/html; charset=utf-8');
my $name = ref($c)->config->{name} || join(' ', split('::', ref $c));
+
+ # Prevent Catalyst::Plugin::Unicode::Encoding from running.
+ # This is a little nasty, but it's the best way to be clean whether or
+ # not the user has an encoding plugin.
+
+ if ($c->can('encoding')) {
+ $c->{encoding} = '';
+ }
my ( $title, $error, $infos );
if ( $c->debug ) {
@@ -279,10 +289,11 @@
</body>
</html>
-
# Trick IE. Old versions of IE would display their own error page instead
# of ours if we'd give it less than 512 bytes.
$c->res->{body} .= ( ' ' x 512 );
+
+ $c->res->{body} = Encode::encode("UTF-8", $c->res->{body});
# Return 500
$c->res->status(500);
Modified: trunk/libcatalyst-perl/lib/Catalyst/Engine/CGI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/lib/Catalyst/Engine/CGI.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/lib/Catalyst/Engine/CGI.pm (original)
+++ trunk/libcatalyst-perl/lib/Catalyst/Engine/CGI.pm Thu Jul 29 06:34:12 2010
@@ -154,6 +154,12 @@
my $scheme = $c->request->secure ? 'https' : 'http';
my $host = $ENV{HTTP_HOST} || $ENV{SERVER_NAME};
my $port = $ENV{SERVER_PORT} || 80;
+
+ # fix up for IIS
+ if ($ENV{SERVER_SOFTWARE} && $ENV{SERVER_SOFTWARE} =~ m{IIS/[6-9]\.\d}) {
+ $ENV{PATH_INFO} =~ s/^\Q$ENV{SCRIPT_NAME}\E//;
+ }
+
my $script_name = $ENV{SCRIPT_NAME};
$script_name =~ s/([^$URI::uric])/$URI::Escape::escapes{$1}/go if $script_name;
Modified: trunk/libcatalyst-perl/lib/Catalyst/Runtime.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/lib/Catalyst/Runtime.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/lib/Catalyst/Runtime.pm (original)
+++ trunk/libcatalyst-perl/lib/Catalyst/Runtime.pm Thu Jul 29 06:34:12 2010
@@ -7,7 +7,7 @@
# Remember to update this in Catalyst as well!
-our $VERSION = '5.80024';
+our $VERSION = '5.80025';
=head1 NAME
Modified: trunk/libcatalyst-perl/lib/Catalyst/Script/Create.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/lib/Catalyst/Script/Create.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/lib/Catalyst/Script/Create.pm (original)
+++ trunk/libcatalyst-perl/lib/Catalyst/Script/Create.pm Thu Jul 29 06:34:12 2010
@@ -46,7 +46,7 @@
Class::MOP::load_class($helper_class);
my $helper = $helper_class->new( { '.newfiles' => !$self->force, mech => $self->mechanize } );
- $self->_getopt_full_usage unless $helper->mk_component( $self->application_name, @ARGV );
+ $self->_getopt_full_usage unless $helper->mk_component( $self->application_name, @{$self->extra_argv} );
}
@@ -68,7 +68,7 @@
Examples:
myapp_create.pl controller My::Controller
myapp_create.pl controller My::Controller BindLex
- myapp_create.pl -mechanize controller My::Controller
+ myapp_create.pl --mechanize controller My::Controller
myapp_create.pl view My::View
myapp_create.pl view MyView TT
myapp_create.pl view TT TT
Modified: trunk/libcatalyst-perl/lib/Catalyst/Script/Server.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/lib/Catalyst/Script/Server.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/lib/Catalyst/Script/Server.pm (original)
+++ trunk/libcatalyst-perl/lib/Catalyst/Script/Server.pm Thu Jul 29 06:34:12 2010
@@ -231,7 +231,7 @@
a restart when modified
(defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
--rdir --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]/..')
--sym --follow_symlinks follow symlinks in search directories
(defaults to false. this is a no-op on Win32)
Modified: trunk/libcatalyst-perl/t/aggregate/unit_core_engine_cgi-prepare_path.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/t/aggregate/unit_core_engine_cgi-prepare_path.t?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/t/aggregate/unit_core_engine_cgi-prepare_path.t (original)
+++ trunk/libcatalyst-perl/t/aggregate/unit_core_engine_cgi-prepare_path.t Thu Jul 29 06:34:12 2010
@@ -86,8 +86,20 @@
is ''.$r->base, 'http://www.foo.com/oslobilder/', 'base correct';
}
+# CGI hit on IIS for non / based app
{
- local $TODO = 'Another mod_rewrite case';
+ my $r = get_req(0,
+ SERVER_SOFTWARE => 'Microsoft-IIS/6.0',
+ PATH_INFO => '/bobtfish/Gitalist/script/gitalist.cgi/static/css/blueprint/screen.css',
+ SCRIPT_NAME => '/bobtfish/Gitalist/script/gitalist.cgi',
+ PATH_TRANSLATED =>
+'C:\\Inetpub\\vhosts\\foo.com\\httpdocs\\bobtfish\\Gitalist\\script\\gitalist.cgi\\static\\css\\blueprint\\screen.css',
+ );
+ is ''.$r->uri, 'http://www.foo.com/bobtfish/Gitalist/script/gitalist.cgi/static/css/blueprint/screen.css';
+ is ''.$r->base, 'http://www.foo.com/bobtfish/Gitalist/script/gitalist.cgi/';
+}
+
+{
my $r = get_req (0,
PATH_INFO => '/auth/login',
SCRIPT_NAME => '/tx',
@@ -112,7 +124,6 @@
is $r->path, 'engine/request/uri/Rx(here)', 'URI contains correct path';
is $r->base, 'http://www.foo.com/', 'Base is correct';
}
-
# FIXME - Test proxy logic
# - Test query string
Modified: trunk/libcatalyst-perl/t/lib/TestApp.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/t/lib/TestApp.pm?rev=60821&op=diff
==============================================================================
--- trunk/libcatalyst-perl/t/lib/TestApp.pm (original)
+++ trunk/libcatalyst-perl/t/lib/TestApp.pm Thu Jul 29 06:34:12 2010
@@ -16,9 +16,38 @@
use Moose;
use namespace::autoclean;
+# -----------
+# t/aggregate/unit_core_ctx_attr.t pukes until lazy is true
+package Greeting;
+use Moose;
+sub hello_notlazy { 'hello there' }
+sub hello_lazy { 'hello there' }
+
+package TestApp;
+has 'my_greeting_obj_notlazy' => (
+ is => 'ro',
+ isa => 'Greeting',
+ default => sub { Greeting->new() },
+ handles => [ qw( hello_notlazy ) ],
+ lazy => 0,
+);
+has 'my_greeting_obj_lazy' => (
+ is => 'ro',
+ isa => 'Greeting',
+ default => sub { Greeting->new() },
+ handles => [ qw( hello_lazy ) ],
+ lazy => 1,
+);
+# -----------
+
our $VERSION = '0.01';
TestApp->config( name => 'TestApp', root => '/some/dir', use_request_uri_for_path => 1 );
+
+# Test bug found when re-adjusting the metaclass compat code in Moose
+# in 292360. Test added to Moose in 4b760d6, but leave this attribute
+# above ->setup so we have some generated methods to be double sure.
+has an_attribute_before_we_change_base_classes => ( is => 'ro');
if ($::setup_leakchecker && eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) {
with 'CatalystX::LeakChecker';
More information about the Pkg-perl-cvs-commits
mailing list