Skip to content

Commit

Permalink
more complete examples for config files
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 19, 2015
1 parent fcba84b commit 83e73b0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion lib/Mojolicious/Plugin/Config.pm
Expand Up @@ -66,7 +66,13 @@ Mojolicious::Plugin::Config - Perl-ish configuration plugin
# myapp.conf (it's just Perl returning a hash)
{
foo => "bar",
# A random value
foo => "bar",
# Nested data structures are fine too
baz => ['♥'],
# You have full access to the application
music_dir => app->home->rel_dir('music')
};
Expand Down
10 changes: 8 additions & 2 deletions lib/Mojolicious/Plugin/JSONConfig.pm
Expand Up @@ -41,8 +41,14 @@ Mojolicious::Plugin::JSONConfig - JSON configuration plugin
# myapp.json (it's just JSON with embedded Perl)
{
"foo" : "bar",
"music_dir" : "<%= app->home->rel_dir('music') %>"
%# A random value
"foo": "bar",
%# Nested data structures are fine too
"baz": ["♥"],
%# You have full access to the application
"music_dir": "<%= app->home->rel_dir('music') %>"
}
# Mojolicious
Expand Down

0 comments on commit 83e73b0

Please sign in to comment.