Added Runtime skeleton.
Marcus Ramberg [Wed, 21 Jun 2006 21:10:03 +0000 (21:10 +0000)]
lib/Catalyst/Runtime.pm [new file with mode: 0644]
lib/Catalyst/View.pm

diff --git a/lib/Catalyst/Runtime.pm b/lib/Catalyst/Runtime.pm
new file mode 100644 (file)
index 0000000..4f64a3c
--- /dev/null
@@ -0,0 +1,29 @@
+package Catalyst::Runtime;
+
+use strict;
+
+our $VERSION='5.70';
+
+=head1 NAME
+
+Catalyst::Runtime - Catalyst  Runtime version
+
+=head1 SYNOPSIS
+
+See L<Catalyst>.
+
+=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;
index d9e884f..51ff5d4 100644 (file)
@@ -32,6 +32,42 @@ action's private name. (See L<Catalyst::Action>.)
 Implements the same methods as other Catalyst components, see
 L<Catalyst::Component>
 
+=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 ) {\r
+        my $right_ref = ( ref $righthash->{ $key } || '' ) eq 'HASH';\r
+        my $left_ref  = ( ( exists $lefthash->{ $key } && ref $lefthash->{ $key } ) || '' ) eq 'HASH';\r
+        if( $right_ref and $left_ref ) {\r
+            $merged{ $key } = $self->merge_config_hashes(
+                $lefthash->{ $key }, $righthash->{ $key }
+            );\r
+        }
+    }
+}
+
+
 =head1 AUTHOR
 
 Sebastian Riedel, C<sri@oook.de>