Skip to content

Commit

Permalink
a few more synopsis examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 30, 2012
1 parent 0df68ec commit ab6921f
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

3.16 2012-07-30
3.16 2012-07-31
- Improved documentation.

3.15 2012-07-28
Expand Down
3 changes: 1 addition & 2 deletions lib/Mojolicious/Commands.pm
Expand Up @@ -141,9 +141,8 @@ Mojolicious::Commands - Command line interface
use Mojolicious::Commands;
# Command line interface
my $commands = Mojolicious::Commands->new;
$commands->run(@ARGV);
push @{$commands->namespaces}, 'MyApp::Command';
=head1 DESCRIPTION
Expand Down
9 changes: 9 additions & 0 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -543,8 +543,17 @@ Mojolicious::Controller - Controller base class
=head1 SYNOPSIS
# Controller
package MyApp::Foo;
use Mojo::Base 'Mojolicious::Controller';
# Action
sub bar {
my $self = shift;
my $name = $self->param('name');
$self->render(json => {hello => $name});
}
=head1 DESCRIPTION
L<Mojolicious::Controller> is the base class for your L<Mojolicious>
Expand Down
1 change: 1 addition & 0 deletions lib/Mojolicious/Plugins.pm
Expand Up @@ -77,6 +77,7 @@ Mojolicious::Plugins - Plugin manager
use Mojolicious::Plugins;
my $plugins = Mojolicious::Plugin->new;
push @{$plugins->namespaces}, 'MyApp::Plugin';
=head1 DESCRIPTION
Expand Down
2 changes: 2 additions & 0 deletions lib/Mojolicious/Renderer.pm
Expand Up @@ -234,6 +234,8 @@ Mojolicious::Renderer - MIME type based renderer
use Mojolicious::Renderer;
my $renderer = Mojolicious::Renderer->new;
push @{$renderer->classes}, 'MyApp::Foo';
push @{renderer->paths}, '/home/sri/templates';
=head1 DESCRIPTION
Expand Down
1 change: 1 addition & 0 deletions lib/Mojolicious/Sessions.pm
Expand Up @@ -81,6 +81,7 @@ Mojolicious::Sessions - Signed cookie based sessions
use Mojolicious::Sessions;
my $sessions = Mojolicious::Sessions->new;
$sessions->cookie_name('myapp');
=head1 DESCRIPTION
Expand Down
2 changes: 2 additions & 0 deletions lib/Mojolicious/Static.pm
Expand Up @@ -140,6 +140,8 @@ Mojolicious::Static - Serve static files
use Mojolicious::Static;
my $static = Mojolicious::Static->new;
push @{$static->classes}, 'MyApp::Foo';
push @{$static->paths}, '/home/sri/public';
=head1 DESCRIPTION
Expand Down
2 changes: 2 additions & 0 deletions lib/Mojolicious/Types.pm
Expand Up @@ -67,6 +67,8 @@ Mojolicious::Types - MIME types
use Mojolicious::Types;
my $types = Mojolicious::Types->new;
$types->type(foo => 'text/foo');
say $types->type('foo');
=head1 DESCRIPTION
Expand Down
8 changes: 4 additions & 4 deletions script/hypnotoad
Expand Up @@ -31,10 +31,10 @@ usage: $0 [OPTIONS] [APPLICATION]
hypnotoad -f myapp.pl
These options are available:
-f, --foreground Keep manager process in foreground.
-h, --help Show this message.
-s, --stop Stop server gracefully.
-t, --test Test application and exit.
-f, --foreground Keep manager process in foreground.
-h, --help Show this message.
-s, --stop Stop server gracefully.
-t, --test Test application and exit.
EOF

# "This is it.
Expand Down

0 comments on commit ab6921f

Please sign in to comment.