]> sipb.mit.edu Git - ikiwiki.git/commitdiff
load YAML on demand
authorJoey Hess <joey@gnu.kitenet.net>
Fri, 19 Mar 2010 20:09:07 +0000 (16:09 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 19 Mar 2010 20:09:07 +0000 (16:09 -0400)
so as not to break test suite if YAML is not avilable

IkiWiki/Setup/Yaml.pm

index ba9192faf6f29ceb4fbb1f4a944de4b41bce3bd6..c7ff1988e850e9e04f3055d21d7018cff5e27234 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",
        "#",