Skip to content

Commit

Permalink
better plugin documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 7, 2012
1 parent b183a2e commit 77165e7
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,6 +1,6 @@
This file documents the revision history for Perl extension Mojolicious.

2.77 2012-04-07
2.77 2012-04-08
- Improved documentation. (tempire, sri)
- Fixed small bug that prevented non-string secrets in Mojolicious.

Expand Down
9 changes: 4 additions & 5 deletions lib/Mojolicious/Plugin/Charset.pm
Expand Up @@ -6,13 +6,12 @@ use Mojo::Base 'Mojolicious::Plugin';
# It also opened my calendar to Friday and ordered me some french fries."
sub register {
my ($self, $app, $conf) = @_;
$conf ||= {};

# Change default charset on all layers
return unless my $s = $conf->{charset};
$app->types->type(html => "text/html;charset=$s");
$app->renderer->encoding($s);
$app->hook(before_dispatch => sub { shift->req->default_charset($s) });
return unless my $c = ($conf || {})->{charset};
$app->types->type(html => "text/html;charset=$c");
$app->renderer->encoding($c);
$app->hook(before_dispatch => sub { shift->req->default_charset($c) });
}

1;
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojolicious/Plugin/Config.pm
Expand Up @@ -134,23 +134,23 @@ L<Mojolicious::Plugin::Config> supports the following options.
# Mojolicious::Lite
plugin Config => {default => {foo => 'bar'}};
Default configuration.
Default configuration, making configuration files optional.
=head2 C<ext>
# Mojolicious::Lite
plugin Config => {ext => 'stuff'};
File extension of configuration file, defaults to C<conf>.
File extension for generated configuration file names, defaults to C<conf>.
=head2 C<file>
# Mojolicious::Lite
plugin Config => {file => 'myapp.conf'};
plugin Config => {file => '/etc/foo.stuff'};
Configuration file, defaults to the value of the C<MOJO_CONFIG> environment
variable or C<myapp.conf> in the application home directory.
Full path to configuration file, defaults to the value of the C<MOJO_CONFIG>
environment variable or C<myapp.conf> in the application home directory.
=head1 METHODS
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Plugin/EPRenderer.pm
Expand Up @@ -124,7 +124,7 @@ Handler name.
# Mojolicious::Lite
plugin EPRenderer => {template => {line_start => '.'}};
Template options.
Attribute values passed to L<Mojo::Template> object used to render templates.
=head1 METHODS
Expand Down
5 changes: 3 additions & 2 deletions lib/Mojolicious/Plugin/JSONConfig.pm
Expand Up @@ -80,7 +80,7 @@ Mojolicious::Plugin::JSONConfig - JSON configuration plugin
L<Mojolicious::Plugin::JSONConfig> is a JSON configuration plugin that
preprocesses it's input with L<Mojo::Template>. The application object can be
accessed via C<$app> or the C<app> helper. You can extend the normal config
accessed via C<$app> or the C<app> function. You can extend the normal config
file C<myapp.json> with C<mode> specific ones like C<myapp.$mode.json>.
=head1 OPTIONS
Expand All @@ -93,7 +93,8 @@ L<Mojolicious::Plugin::Config> and supports the following new ones.
# Mojolicious::Lite
plugin JSONConfig => {template => {line_start => '.'}};
Template options.
Attribute values passed to L<Mojo::Template> object used to preprocess
configuration files.
=head1 METHODS
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Plugin/PODRenderer.pm
Expand Up @@ -18,9 +18,9 @@ my $PERLDOC = $Mojolicious::Controller::H->slurp_rel_file('perldoc.html.ep');
# pleasant one."
sub register {
my ($self, $app, $conf) = @_;
$conf ||= {};

# Config
$conf ||= {};
my $name = $conf->{name} || 'pod';
my $preprocess = $conf->{preprocess} || 'ep';

Expand Down Expand Up @@ -197,7 +197,7 @@ Disable perldoc browser.
# Mojolicious::Lite
plugin PODRenderer => {preprocess => 'epl'};
Handler name of preprocessor.
Name of handler used to preprocess POD.
=head1 HELPERS
Expand Down

0 comments on commit 77165e7

Please sign in to comment.