Dancer-Plugin-DynamicConfig

 view release on metacpan or  search on metacpan

README.pod  view on Meta::CPAN


In your Dancer configuration, you declare a "tag" for the file, a path to the
file, and an (optional) rewrite_class. You can then call C<dynamic_config()>,
passing in your tag, and you will receive back a data structure that
represents the contents of the file on disk. C<dynamic_config()> will cache
the data, and only re-read it when the file's mtime has changed.

=head2 The rewrite_class

This class, if provided, must implement one class method, C<rewrite()>, which
takes the decoded data structure represented by the file's contents.
C<rewrite()> may then return any data structure it likes, and this structure
will be passed back as the return value of C<dynamic_config()>.

=head2 Filetypes

Currently, B<Dancer::Plugin::DynamicConfig> only supports JSON files, and requires
that the filename end in C<".json">. Generalizing this behavior is on the short
list of coming improvements.

=head2 KEYWORDS

lib/Dancer/Plugin/DynamicConfig.pm  view on Meta::CPAN


In your Dancer configuration, you declare a "tag" for the file, a path to the
file, and an (optional) rewrite_class. You can then call C<dynamic_config()>,
passing in your tag, and you will receive back a data structure that
represents the contents of the file on disk. C<dynamic_config()> will cache
the data, and only re-read it when the file's mtime has changed.

=head2 The rewrite_class

This class, if provided, must implement one class method, C<rewrite()>, which
takes the decoded data structure represented by the file's contents.
C<rewrite()> may then return any data structure it likes, and this structure
will be passed back as the return value of C<dynamic_config()>.

=head2 Filetypes

Currently, B<Dancer::Plugin::DynamicConfig> only supports JSON files, and requires
that the filename end in C<".json">. Generalizing this behavior is on the short
list of coming improvements.

=head2 KEYWORDS



( run in 0.299 second using v1.01-cache-2.11-cpan-26ccb49234f )