]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
refactor
authorJoey Hess <joey@kodama.kitenet.net>
Sat, 26 Jul 2008 19:39:41 +0000 (15:39 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sat, 26 Jul 2008 19:39:41 +0000 (15:39 -0400)
IkiWiki/Setup.pm
IkiWiki/Setup/Standard.pm
ikiwiki.in

index 9c45a8baf30081d792abfcc70da8609e8fc1b437..adb8abb6280199527667d03ad1ede171f74a3824 100644 (file)
@@ -62,4 +62,14 @@ sub load ($) { # {{{
        }
 } #}}}
 
+sub dump ($) { #{{{
+       my $file=IkiWiki::possibly_foolish_untaint(shift);
+       
+       require IkiWiki::Setup::Standard;
+
+       open (OUT, ">", $file) || die "$file: $!";
+       print OUT "$_\n" foreach IkiWiki::Setup::Standard::gendump();
+       close OUT;
+}
+
 1
index ed4331d6143cc5086b6aa02b31144bad86aafa8a..22bfc38a40440df88915375e2d02dd307aebe0e1 100644 (file)
@@ -71,9 +71,7 @@ sub dumpvalues ($@) { #{{{
        return @ret;
 } #}}}
 
-sub dump ($) { #{{{
-       my $file=IkiWiki::possibly_foolish_untaint(shift);
-       
+sub gendump () { #{{{
        my %setup=(%config);
        my @ret;
        
@@ -100,9 +98,7 @@ sub dump ($) { #{{{
 use IkiWiki::Setup::Standard {";
        push @ret, "}";
 
-       open (OUT, ">", $file) || die "$file: $!";
-       print OUT "$_\n" foreach @ret;
-       close OUT;
+       return @ret;
 } #}}}
 
 1
index 8cb8a476939a211a862cc2c185f64d783831dfdb..febc8ff56ed42ee876b85db2b235270961737963 100755 (executable)
@@ -150,8 +150,8 @@ sub main () { #{{{
        }
 
        if ($config{dumpsetup}) {
-               require IkiWiki::Setup::Standard;
-               IkiWiki::Setup::Standard::dump($config{dumpsetup});
+               require IkiWiki::Setup;
+               IkiWiki::Setup::dump($config{dumpsetup});
        }
        elsif ($config{wrapper}) {
                lockwiki();