--- trunk/lib/Frey/Config.pm 2008/10/31 23:10:08 221 +++ trunk/lib/Frey/Config.pm 2008/11/17 19:33:29 383 @@ -1,6 +1,8 @@ package Frey::Config; use Moose::Role; +#requires 'debug'; + use YAML qw/LoadFile/; use Hash::Merge qw/merge/; use Data::Dump qw/dump/; @@ -43,16 +45,17 @@ } else { %config = %{ merge( LoadFile($path) , \%config ) } if -e $path; } - warn "## $path current config = ",dump( %config ) if $self->debug; + warn "## load_config $path current config = ",dump( %config ) if $self->debug; } } sub config { - my $self = shift; - my $key = shift || ref($self); + my ( $self, $key ) = @_; + $key ||= ref($self); warn "## config $key" if $self->debug; $self->load_config unless defined %config; - confess "$key doesn't exist in config" unless defined $config{ $key }; + #confess "$key doesn't exist in config" unless defined $config{ $key }; + return unless defined $config{ $key }; return $config{ $key }; }