Better config logic
[scpubgit/App-SCS.git] / lib / App / SCS / PageSet.pm
index 731f493..fdaf442 100644 (file)
@@ -111,12 +111,16 @@ sub _inflate {
   }
   my $raw = $io->all;
   try {
+
     my $extracted = $self->${\"_extract_from_${type}"}($raw);
     my $jsony = JSONY->new;
-    my $config = reduce { merge($a, $jsony->load($b->all)) } {}, @$config_files;
+    my $config = reduce { merge($a, $jsony->load($b->all)) } [], @$config_files;
 
     $extracted->{plugins} = pond_read_datum('[' . $extracted->{plugins} . ']');
-    my $setup = merge($extracted, $config);
+
+    my $setup = $extracted;
+
+    $setup->{plugin_config} = merge($extracted->{plugins}, $config);
 
     try {
         my $tmp_cache = io($cache_name . ".tmp");