Skip to content

Commit

Permalink
_set_setting instead of setting
Browse files Browse the repository at this point in the history
  • Loading branch information
fcuny committed Nov 22, 2010
1 parent a67fa01 commit 807f386
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/Dancer/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,17 @@ sub load_settings_from_yaml {
my $config;

eval { $config = YAML::LoadFile($file) };
if ( my $err = $@ || (!$config)) {
if (my $err = $@ || (!$config)) {
confess "Unable to parse the configuration file: $file: $@";
}

for my $key (keys %{$config}) {
if ($MERGEABLE{$key}) {
my $setting = setting($key);
$setting->{$_} = $config->{$key}{$_}
for keys %{$config->{$key}};
$setting->{$_} = $config->{$key}{$_} for keys %{$config->{$key}};
}
else {
setting($key, $config->{$key});
_set_setting($key, $config->{$key});
}
}

Expand All @@ -208,7 +207,7 @@ sub load_default_settings {
|| $ENV{PLACK_ENV}
|| 'development';

setting $_ => {} for keys %MERGEABLE;
setting $_ => {} for keys %MERGEABLE;
setting template => 'simple';
setting import_warnings => 1;
}
Expand Down

0 comments on commit 807f386

Please sign in to comment.