Skip to content

Commit

Permalink
fixed config plugin documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 27, 2012
1 parent 228c90b commit 2535ec0
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

3.01 2012-06-26
3.01 2012-06-27
- Improved documentation. (diegok, sri)

3.0 2012-06-25
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Loader.pm
Expand Up @@ -71,7 +71,7 @@ sub _all {
my $content = join '', <$handle>;
close $handle;

# Ignore everything before __DATA__ (windows will seek to start of file)
# Ignore everything before __DATA__ (Windows will seek to start of file)
$content =~ s/^.*\n__DATA__\r?\n/\n/s;

# Ignore everything after __END__
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -40,7 +40,7 @@ sub DESTROY {
sub run {
my ($self, $path) = @_;

# No windows support
# No Windows support
_exit('Hypnotoad not available for Windows.') if $^O eq 'MSWin32';

# Application
Expand Down
8 changes: 5 additions & 3 deletions lib/Mojolicious/Plugin/Config.pm
Expand Up @@ -72,9 +72,8 @@ sub register {
$config = {%$config, %{$self->load($mode, $conf, $app)}}
if defined $mode && -e $mode;
$config = {%{$conf->{default}}, %$config} if $conf->{default};
my $current = $app->config;
my $current = $app->defaults(config => $app->config)->config;
%$current = (%$current, %$config);
$app->defaults(config => $current);

return $current;
}
Expand All @@ -99,7 +98,10 @@ Mojolicious::Plugin::Config - Perl-ish configuration plugin
# Mojolicious::Lite
my $config = plugin 'Config';
# Reads "myapp.conf" by default
# foo.html.ep
%= $config->{foo}
# The configuration is available application wide
my $config = app->config;
# Everything can be customized with options
Expand Down
5 changes: 4 additions & 1 deletion lib/Mojolicious/Plugin/JSONConfig.pm
Expand Up @@ -58,7 +58,10 @@ Mojolicious::Plugin::JSONConfig - JSON configuration plugin
# Mojolicious::Lite
my $config = plugin 'JSONConfig';
# Reads "myapp.json" by default
# foo.html.ep
%= $config->{foo}
# The configuration is available application wide
my $config = app->config;
# Everything can be customized with options
Expand Down
5 changes: 2 additions & 3 deletions lib/Mojolicious/Plugin/PODRenderer.pm
Expand Up @@ -148,14 +148,13 @@ Mojolicious::Plugin::PODRenderer - POD renderer plugin
my $route = $self->plugin('PODRenderer');
my $route = $self->plugin(PODRenderer => {name => 'foo'});
my $route = $self->plugin(PODRenderer => {preprocess => 'epl'});
$self->render('some_template', handler => 'pod');
%= pod_to_html "=head1 TEST\n\nC<123>"
# Mojolicious::Lite
my $route = plugin 'PODRenderer';
my $route = plugin PODRenderer => {name => 'foo'};
my $route = plugin PODRenderer => {preprocess => 'epl'};
$self->render('some_template', handler => 'pod');
# foo.html.ep
%= pod_to_html "=head1 TEST\n\nC<123>"
=head1 DESCRIPTION
Expand Down

0 comments on commit 2535ec0

Please sign in to comment.