[Catalyst] Howto use ConfigLoader?
Johannes Rumpf
jrspam at web-dreamer.de
Sun May 13 00:58:35 GMT 2007
Ok, thats it. With this script i was able to test the YML and it was
indeed invalid. After validating everything works like a charm.
Thanks :-)
Johannes
Jonathan Rockway schrieb:
> On Saturday 12 May 2007 11:09:26 am John Romkey wrote:
>> You'll see that message even if there's an error in the config file.
>> YAML is very sensitive about whitespace. Try running the file through
>> ysh, the YAML shell, to check for errors.
>
> This is a waste of time. I recommend adding a test to your test suite that
> validates the YAML with Test::YAML::Valid:
>
> #!/usr/bin/env perl
> use strict;
> use warnings;
> use Test::More tests => 2;
> use Test::YAML::Valid;
>
> my $CONFIG = 'myapp.yml';
>
> ok(-e $CONFIG, "$CONFIG exists");
> yaml_file_ok($CONFIG ,"$CONFIG validates");
>
> Now you never have to worry about invalid YAML again. (You might /have/ it,
> but you won't have to /worry/ about it ;)
>
> Regards,
> Jonathan Rockway
>
More information about the Catalyst
mailing list