Dancer-Plugin-DynamicConfig

 view release on metacpan or  search on metacpan

t/unit/lib/Dancer/Plugin/DynamicConfig/basic.t  view on Meta::CPAN

    this => "THAT",
    array => [ qw(these are some items) ],
    hash => { key1 => "VAL1", key2 => "VAL2" },
    aofh => [
      { k1a => "V1A", k1b => "V1B" },
      { k2a => "K2B" }
    ]
  }
);

sub update_dynamic_config {
  my ($key, $val) = @_;

  my $plugins = Dancer::Config::setting('plugins');
  $plugins->{DynamicConfig}{$key} = $val;
  set plugins => $plugins;

  Dancer::Plugin::DynamicConfig->reinitialize; # pick up change to $plugins
}

# we pick up on changes to the file without having to explicitly reinitialize things



( run in 0.237 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )