From: Marcus Ramberg Date: Wed, 21 Jun 2006 21:10:03 +0000 (+0000) Subject: Added Runtime skeleton. X-Git-Tag: 5.7099_04~510 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=a8dc76a1260561f17e6513a243473967582ed48a;hp=9a6ecf4f8186b42c4c86206b20435c60dc03e012 Added Runtime skeleton. --- diff --git a/lib/Catalyst/Runtime.pm b/lib/Catalyst/Runtime.pm new file mode 100644 index 0000000..4f64a3c --- /dev/null +++ b/lib/Catalyst/Runtime.pm @@ -0,0 +1,29 @@ +package Catalyst::Runtime; + +use strict; + +our $VERSION='5.70'; + +=head1 NAME + +Catalyst::Runtime - Catalyst Runtime version + +=head1 SYNOPSIS + +See L. + +=head1 DESCRIPTION + +Catalyst Runtime class. + +=head1 AUTHOR + + +=head1 COPYRIGHT + +This program is free software, you can redistribute it and/or modify it under +the same terms as Perl itself. + +=cut + +1; diff --git a/lib/Catalyst/View.pm b/lib/Catalyst/View.pm index d9e884f..51ff5d4 100644 --- a/lib/Catalyst/View.pm +++ b/lib/Catalyst/View.pm @@ -32,6 +32,42 @@ action's private name. (See L.) Implements the same methods as other Catalyst components, see L +=head2 process + +gives an error message about direct use. + +=cut + +sub process { + + Catalyst::Exception->throw( message => ( ref $_[0] || $_[0] ). + " directly inherits from Catalyst::View. You need to\n". + " inherit from a subclass like Catalyst::View::TT instead.\n" ); + +} + +=head2 $c->merge_hash_config( $hashref, $hashref ) + +Merges two hashes together recursively, giving right-hand precedence. + +=cut + +sub merge_config_hashes { + my ( $self, $lefthash, $righthash ) = @_; + + my %merged = %$lefthash; + for my $key ( keys %$righthash ) { + my $right_ref = ( ref $righthash->{ $key } || '' ) eq 'HASH'; + my $left_ref = ( ( exists $lefthash->{ $key } && ref $lefthash->{ $key } ) || '' ) eq 'HASH'; + if( $right_ref and $left_ref ) { + $merged{ $key } = $self->merge_config_hashes( + $lefthash->{ $key }, $righthash->{ $key } + ); + } + } +} + + =head1 AUTHOR Sebastian Riedel, C