Skip to content

Commit

Permalink
better examples for many Mojolicious methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 23, 2012
1 parent 496d4e1 commit a0b0646
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 29 deletions.
2 changes: 1 addition & 1 deletion lib/Mojolicious/Command/generate/plugin.pm
Expand Up @@ -69,7 +69,7 @@ L<Mojolicious::Plugin> and implements the following new ones.
<% %>=head2 C<register>
$plugin->register($app);
$plugin->register(Mojolicious->new);
Register plugin in L<Mojolicious> application.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Plugin/Charset.pm
Expand Up @@ -54,7 +54,7 @@ L<Mojolicious::Plugin> and implements the following new ones.
=head2 C<register>
$plugin->register($app, $conf);
$plugin->register(Mojolicious->new, {charset => 'Shift_JIS'});
Register plugin hooks in L<Mojolicious> application.
Expand Down
3 changes: 2 additions & 1 deletion lib/Mojolicious/Plugin/Config.pm
Expand Up @@ -179,7 +179,8 @@ Parse configuration file.
=head2 C<register>
my $config = $plugin->register($app, $conf);
my $config = $plugin->register(Mojolicious->new);
my $config = $plugin->register(Mojolicious->new, {file => '/etc/app.conf'});
Register plugin in L<Mojolicious> application.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Plugin/DefaultHelpers.pm
Expand Up @@ -295,7 +295,7 @@ L<Mojolicious::Plugin> and implements the following new ones.
=head2 C<register>
$plugin->register($app);
$plugin->register(Mojolicious->new);
Register helpers in L<Mojolicious> application.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Plugin/EPLRenderer.pm
Expand Up @@ -102,7 +102,7 @@ L<Mojolicious::Plugin> and implements the following new ones.
=head2 C<register>
$plugin->register($app);
$plugin->register(Mojolicious->new);
Register renderer in L<Mojolicious> application.
Expand Down
3 changes: 2 additions & 1 deletion lib/Mojolicious/Plugin/EPRenderer.pm
Expand Up @@ -116,7 +116,8 @@ L<Mojolicious::Plugin> and implements the following new ones.
=head2 C<register>
$plugin->register($app, $conf);
$plugin->register(Mojolicious->new);
$plugin->register(Mojolicious->new, {name => 'foo'});
Register renderer in L<Mojolicious> application.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Plugin/HeaderCondition.pm
Expand Up @@ -81,7 +81,7 @@ L<Mojolicious::Plugin> and implements the following new ones.
=head2 C<register>
$plugin->register($app);
$plugin->register(Mojolicious->new);
Register condition in L<Mojolicious> application.
Expand Down
3 changes: 2 additions & 1 deletion lib/Mojolicious/Plugin/JSONConfig.pm
Expand Up @@ -115,7 +115,8 @@ Process content with C<render> and parse it with L<Mojo::JSON>.
=head2 C<register>
my $config = $plugin->register($app, $conf);
my $config = $plugin->register(Mojolicious->new);
my $config = $plugin->register(Mojolicious->new, {file => '/etc/foo.conf'});
Register plugin in L<Mojolicious> application.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Plugin/Mount.pm
Expand Up @@ -68,7 +68,7 @@ and implements the following new ones.
=head2 C<register>
my $route = $plugin->register($app, $conf);
my $route = $plugin->register(Mojolicious->new, {'/foo' => '/some/app.pl'});
Mount L<Mojolicious> application.
Expand Down
5 changes: 3 additions & 2 deletions lib/Mojolicious/Plugin/PODRenderer.pm
Expand Up @@ -198,7 +198,7 @@ L<Mojolicious::Plugin::PODRenderer> implements the following helpers.
%= pod_to_html '=head2 lalala'
<%= pod_to_html begin %>=head2 lalala<% end %>
Render POD to HTML.
Render POD to HTML without preprocessing.
=head1 METHODS
Expand All @@ -207,7 +207,8 @@ L<Mojolicious::Plugin> and implements the following new ones.
=head2 C<register>
my $route = $plugin->register($app, $conf);
my $route = $plugin->register(Mojolicious->new);
my $route = $plugin->register(Mojolicious->new, {name => 'foo'});
Register renderer in L<Mojolicious> application.
Expand Down
3 changes: 2 additions & 1 deletion lib/Mojolicious/Plugin/PoweredBy.pm
Expand Up @@ -55,7 +55,8 @@ L<Mojolicious::Plugin> and implements the following new ones.
=head2 C<register>
$plugin->register($app, $conf);
$plugin->register(Mojolicious->new);
$plugin->register(Mojolicious->new, {name => 'MyFramework 1.0'});
Register plugin hooks in L<Mojolicious> application.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Plugin/RequestTimer.pm
Expand Up @@ -74,7 +74,7 @@ L<Mojolicious::Plugin> and implements the following new ones.
=head2 C<register>
$plugin->register($app);
$plugin->register(Mojolicious->new);
Register plugin hooks in L<Mojolicious> application.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Plugin/TagHelpers.pm
Expand Up @@ -602,7 +602,7 @@ L<Mojolicious::Plugin> and implements the following new ones.
=head2 C<register>
$plugin->register($app);
$plugin->register(Mojolicious->new);
Register helpers in L<Mojolicious> application.
Expand Down
20 changes: 11 additions & 9 deletions lib/Mojolicious/Plugins.pm
Expand Up @@ -133,15 +133,17 @@ Load a plugin from the configured namespaces or by full module name.
=head2 C<register_plugin>
$plugins->register_plugin('some_thing', $app);
$plugins->register_plugin('some_thing', $app, foo => 23);
$plugins->register_plugin('some_thing', $app, {foo => 23});
$plugins->register_plugin('SomeThing', $app);
$plugins->register_plugin('SomeThing', $app, foo => 23);
$plugins->register_plugin('SomeThing', $app, {foo => 23});
$plugins->register_plugin('MyApp::Plugin::SomeThing', $app);
$plugins->register_plugin('MyApp::Plugin::SomeThing', $app, foo => 23);
$plugins->register_plugin('MyApp::Plugin::SomeThing', $app, {foo => 23});
$plugins->register_plugin('some_thing', Mojolicious->new);
$plugins->register_plugin('some_thing', Mojolicious->new, foo => 23);
$plugins->register_plugin('some_thing', Mojolicious->new, {foo => 23});
$plugins->register_plugin('SomeThing', Mojolicious->new);
$plugins->register_plugin('SomeThing', Mojolicious->new, foo => 23);
$plugins->register_plugin('SomeThing', Mojolicious->new, {foo => 23});
$plugins->register_plugin('MyApp::Plugin::SomeThing', Mojolicious->new);
$plugins->register_plugin(
'MyApp::Plugin::SomeThing', Mojolicious->new, foo => 23);
$plugins->register_plugin(
'MyApp::Plugin::SomeThing', Mojolicious->new, {foo => 23});
Load a plugin from the configured namespaces or by full module name and run
C<register>, optional arguments are passed through.
Expand Down
12 changes: 6 additions & 6 deletions lib/Mojolicious/Routes/Route.pm
Expand Up @@ -399,9 +399,9 @@ L<Mojolicious::Lite> tutorial for more argument variations.
$r = $r->detour('controller#action');
$r = $r->detour('controller#action', foo => 'bar');
$r = $r->detour('controller#action', {foo => 'bar'});
$r = $r->detour($app);
$r = $r->detour($app, foo => 'bar');
$r = $r->detour($app, {foo => 'bar'});
$r = $r->detour(Mojolicious->new);
$r = $r->detour(Mojolicious->new, foo => 'bar');
$r = $r->detour(Mojolicious->new, {foo => 'bar'});
$r = $r->detour('MyApp');
$r = $r->detour('MyApp', foo => 'bar');
$r = $r->detour('MyApp', {foo => 'bar'});
Expand Down Expand Up @@ -566,9 +566,9 @@ Generate route matching all HTTP request methods.
$r = $r->to('controller#action');
$r = $r->to('controller#action', foo => 'bar');
$r = $r->to('controller#action', {foo => 'bar'});
$r = $r->to($app);
$r = $r->to($app, foo => 'bar');
$r = $r->to($app, {foo => 'bar'});
$r = $r->to(Mojolicious->new);
$r = $r->to(Mojolicious->new, foo => 'bar');
$r = $r->to(Mojolicious->new, {foo => 'bar'});
$r = $r->to('MyApp');
$r = $r->to('MyApp', foo => 'bar');
$r = $r->to('MyApp', {foo => 'bar'});
Expand Down

0 comments on commit a0b0646

Please sign in to comment.