Author: dylan
Date: 2005-06-24 23:55:40 -0400 (Fri, 24 Jun 2005)
New Revision: 814

Modified:
   trunk/
   trunk/perl/core/lib/Haver/Config.pm
   trunk/perl/core/t/001_config.t
Log:
 [EMAIL PROTECTED]:  dylan | 2005-06-24 23:36:00 -0400
 added AUTOLOAD support.



Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 1f59643a-e6e5-0310-bc24-f7d4c744f460:/haver/havercurs-objc:43089
1f59643a-e6e5-0310-bc24-f7d4c744f460:/haver/local/trunk:11166
1f59643a-e6e5-0310-bc24-f7d4c744f460:/haver/local/trunk-merge-10131:11178
27e50396-46e3-0310-8b22-ae223a1f35ce:/local:212
e9404bb1-7af0-0310-a7ff-e22194cd388b:/haver/local:1172
edfcd8bd-4ce7-0310-a97e-bb1efd40edf3:/local:238
   + 1f59643a-e6e5-0310-bc24-f7d4c744f460:/haver/havercurs-objc:43089
1f59643a-e6e5-0310-bc24-f7d4c744f460:/haver/local/trunk:11166
1f59643a-e6e5-0310-bc24-f7d4c744f460:/haver/local/trunk-merge-10131:11178
27e50396-46e3-0310-8b22-ae223a1f35ce:/local:212
e9404bb1-7af0-0310-a7ff-e22194cd388b:/haver/local:1175
edfcd8bd-4ce7-0310-a97e-bb1efd40edf3:/local:238

Modified: trunk/perl/core/lib/Haver/Config.pm
===================================================================
--- trunk/perl/core/lib/Haver/Config.pm 2005-06-25 02:08:34 UTC (rev 813)
+++ trunk/perl/core/lib/Haver/Config.pm 2005-06-25 03:55:40 UTC (rev 814)
@@ -58,6 +58,13 @@
     delete $self->{config}{$key};
 }
 
+sub AUTOLOAD {
+    our $AUTOLOAD;
+    my ($self)   = shift;
+    my ($method) = $AUTOLOAD =~ /::(\w+)$/;
+    return $self->{config}{$method};
+}
+
 # Author: bdonlan
 sub _merge_struct ($$) {
        # ASSERT: @_ == 2;

Modified: trunk/perl/core/t/001_config.t
===================================================================
--- trunk/perl/core/t/001_config.t      2005-06-25 02:08:34 UTC (rev 813)
+++ trunk/perl/core/t/001_config.t      2005-06-25 03:55:40 UTC (rev 814)
@@ -5,7 +5,7 @@
 
 # change 'tests => 1' to 'tests => last_test_to_print';
 
-use Test::More tests => 6;
+use Test::More tests => 7;
 BEGIN {
        use_ok('Haver::Config');
 };
@@ -48,3 +48,5 @@
 $ch2->merge($stuff);
 
 is_deeply($ch->config, $ch2->config, "Saved properly");
+
+is(eval { $ch->foo }, 'bar', "AUTOLOAD");


Reply via email to