load YAML on demand

so as not to break test suite if YAML is not avilable
master
Joey Hess 2010-03-19 16:09:07 -04:00
parent 07bb08d094
commit 3b08789e6f
1 changed files with 5 additions and 1 deletions

View 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",
"#",