[Catalyst-commits] r6920 - in trunk/Catalyst-Plugin-ConfigLoader-Remote: lib/Catalyst/Plugin/ConfigLoader t t/conf t/lib

jshirley at dev.catalyst.perl.org jshirley at dev.catalyst.perl.org
Tue Sep 18 18:26:36 GMT 2007


Author: jshirley
Date: 2007-09-18 18:26:35 +0100 (Tue, 18 Sep 2007)
New Revision: 6920

Added:
   trunk/Catalyst-Plugin-ConfigLoader-Remote/t/conf/
   trunk/Catalyst-Plugin-ConfigLoader-Remote/t/conf/test1.yml
Modified:
   trunk/Catalyst-Plugin-ConfigLoader-Remote/lib/Catalyst/Plugin/ConfigLoader/Remote.pm
   trunk/Catalyst-Plugin-ConfigLoader-Remote/t/lib/TestApp.pm
Log:
Basic live tests work, pulling a file from the test suite... should work fine.

Modified: trunk/Catalyst-Plugin-ConfigLoader-Remote/lib/Catalyst/Plugin/ConfigLoader/Remote.pm
===================================================================
--- trunk/Catalyst-Plugin-ConfigLoader-Remote/lib/Catalyst/Plugin/ConfigLoader/Remote.pm	2007-09-18 17:13:08 UTC (rev 6919)
+++ trunk/Catalyst-Plugin-ConfigLoader-Remote/lib/Catalyst/Plugin/ConfigLoader/Remote.pm	2007-09-18 17:26:35 UTC (rev 6920)
@@ -7,6 +7,8 @@
 use Scalar::Util qw(blessed);
 use File::Temp qw/tempdir/;
 
+use Class::C3;
+
 use base qw/Catalyst::Plugin::ConfigLoader/;
 
 =head1 NAME
@@ -57,11 +59,14 @@
 sub find_files {
     my $c = shift;
 
-    my @files   = ();
     my $tempdir = tempdir( CLEANUP => 1 );
 
-    my @incoming_files = $c->next::method();
+    # Load up the other files that are coming in.
+    my @files = $c->next::method();
 
+    my @incoming_files =
+        @{ $c->config->{'Plugin::ConfigLoader::Remote'}->{files} };
+
     # replace everything in @files that is a URI object with a downloaded copy
     foreach my $arg ( @incoming_files ) {
         if ( blessed $arg and $arg->isa('URI') ) {
@@ -77,6 +82,7 @@
             push @files, $arg;
         }
     }
+
     return @files;
 }
 

Added: trunk/Catalyst-Plugin-ConfigLoader-Remote/t/conf/test1.yml
===================================================================
--- trunk/Catalyst-Plugin-ConfigLoader-Remote/t/conf/test1.yml	                        (rev 0)
+++ trunk/Catalyst-Plugin-ConfigLoader-Remote/t/conf/test1.yml	2007-09-18 17:26:35 UTC (rev 6920)
@@ -0,0 +1,9 @@
+---
+name: Basic Test 1
+scalar: foo
+array:
+    - foo
+    - bar
+    - baz
+hash:
+    foo: bar

Modified: trunk/Catalyst-Plugin-ConfigLoader-Remote/t/lib/TestApp.pm
===================================================================
--- trunk/Catalyst-Plugin-ConfigLoader-Remote/t/lib/TestApp.pm	2007-09-18 17:13:08 UTC (rev 6919)
+++ trunk/Catalyst-Plugin-ConfigLoader-Remote/t/lib/TestApp.pm	2007-09-18 17:26:35 UTC (rev 6920)
@@ -6,8 +6,20 @@
 use Catalyst::Runtime '5.70';
 use Test::More;
 
+use URI;
+use FindBin;
+
 use Catalyst qw(ConfigLoader::Remote Static::Simple);
 
+
+__PACKAGE__->config(
+    'Plugin::ConfigLoader::Remote' => {
+        files => [
+            URI->new("file://$FindBin::Bin/conf/test1.yml")
+        ]
+    }
+);
+
 __PACKAGE__->setup;
 
 sub root : Chained('/') PathPart('') CaptureArgs(0) {




More information about the Catalyst-commits mailing list