]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Setup/Yaml.pm
reset setuptype to standard after an automator setup file is loaded
[git.ikiwiki.info.git] / IkiWiki / Setup / Yaml.pm
index ba9192faf6f29ceb4fbb1f4a944de4b41bce3bd6..0fc2736756d73ba099b27961a2772a769731b204 100644 (file)
@@ -5,17 +5,21 @@ package IkiWiki::Setup::Yaml;
 use warnings;
 use strict;
 use IkiWiki;
-use YAML;
 
 sub loaddump ($$) {
        my $class=shift;
        my $content=shift;
 
+       eval q{use YAML};
+       die $@ if $@;
        IkiWiki::Setup::merge(Load($content));
 }
 
 sub gendump ($@) {
        my $class=shift;
+       
+       eval q{use YAML};
+       die $@ if $@;
 
        "# IkiWiki::Setup::Yaml - YAML formatted setup file",
        "#",
@@ -35,7 +39,7 @@ sub dumpline ($$$$) {
        my $dump=Dump({$key => $value});
        chomp $dump;
        if (length $prefix) {
-               $dump=join("", map { $prefix.$_ } split(/\n/, $dump));
+               $dump=join("\n", map { $prefix.$_ } split(/\n/, $dump));
        }
        return $dump;
 }