Skip to content

Commit

Permalink
documentation tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 10, 2012
1 parent 2592a85 commit c813d75
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/Mojo/DOM.pm
Expand Up @@ -706,7 +706,7 @@ Render this element and its content to XML.
=head2 C<tree>
my $tree = $dom->tree;
$dom = $dom->tree(['root', ['text', 'lalala']]);
$dom = $dom->tree(['root', [qw(text lalala)]]);
Alias for L<Mojo::DOM::HTML/"tree">.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/DOM/CSS.pm
Expand Up @@ -604,7 +604,7 @@ L<Mojo::DOM::CSS> implements the following attributes.
=head2 C<tree>
my $tree = $css->tree;
$css = $css->tree(['root', ['text', 'lalala']]);
$css = $css->tree(['root', [qw(text lalala)]]);
Document Object Model.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/DOM/HTML.pm
Expand Up @@ -425,7 +425,7 @@ Charset used for decoding and encoding HTML5/XML.
=head2 C<tree>
my $tree = $html->tree;
$html = $html->tree(['root', ['text', 'lalala']]);
$html = $html->tree(['root', [qw(text lalala)]]);
Document Object Model.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Server/Daemon.pm
Expand Up @@ -371,7 +371,7 @@ List of one or more locations to listen on, defaults to the value of the
C<MOJO_LISTEN> environment variable or C<http://*:3000>.
# Listen on two ports with HTTP and HTTPS at the same time
$daemon->listen(['http://*:3000', 'https://*:4000']);
$daemon->listen([qw(http://*:3000 https://*:4000)]);
# Use a custom certificate and key
$daemon->listen(['https://*:3000?cert=/x/server.crt&key=/y/server.key']);
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/UserAgent.pm
Expand Up @@ -764,7 +764,7 @@ Value for C<User-Agent> request header, defaults to C<Mojolicious (Perl)>.
=head2 C<no_proxy>
my $no_proxy = $ua->no_proxy;
$ua = $ua->no_proxy(['localhost', 'intranet.mojolicio.us']);
$ua = $ua->no_proxy([qw(localhost intranet.mojolicio.us)]);
Domains that don't require a proxy server to be used.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/UserAgent/Transactor.pm
Expand Up @@ -279,7 +279,7 @@ Actual endpoint for transaction.
my $tx = $t->form('kraih.com' => {a => 'b'});
my $tx = $t->form('http://kraih.com' => {a => 'b'});
my $tx = $t->form('http://kraih.com' => {a => ['b', 'c', 'd']});
my $tx = $t->form('http://kraih.com' => {a => [qw(b c d)]});
my $tx = $t->form('http://kraih.com' => {mytext => {file => '/foo.txt'}});
my $tx = $t->form('http://kraih.com' => {mytext => {content => 'lalala'}});
my $tx = $t->form('http://kraih.com' => {
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -254,7 +254,7 @@ Any of the native Perl data types can be passed to templates through the
L<Mojolicious::Controller/"stash">.

$self->stash(author => 'Sebastian');
$self->stash(frameworks => ['Catalyst', 'Mojolicious']);
$self->stash(frameworks => [qw(Catalyst Mojolicious)]);
$self->stash(examples => {tweetylicious => 'a microblogging app'});

%= $author
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -366,7 +366,7 @@ just make a list of possible values.
# /bender -> {controller => 'foo', action => 'bar', name => 'bender'}
# /leela -> {controller => 'foo', action => 'bar', name => 'leela'}
# /fry -> undef
$r->route('/:name', name => ['bender', 'leela'])
$r->route('/:name', name => [qw(bender leela)])
->to(controller => 'foo', action => 'bar');

You can also adjust the regular expressions behind placeholders to better suit
Expand Down Expand Up @@ -409,7 +409,7 @@ Restrictive placeholders can also be used.
# /foo.rss -> {controller => 'foo', action => 'bar', format => 'rss'}
# /foo.xml -> {controller => 'foo', action => 'bar', format => 'xml'}
# /foo.txt -> undef
$r->route('/foo', format => ['rss', 'xml'])
$r->route('/foo', format => [qw(rss xml)])
->to(controller => 'foo', action => 'bar');

Or you can just disable format detection, which gets inherited by nested
Expand All @@ -427,7 +427,7 @@ routes and allows selective re-enabling.
# /baz.xml -> undef
my $inactive = $r->route(format => 0);
$inactive->route('/foo')->to('foo#none');
$inactive->route('/baz', format => ['txt', 'html'])->to('bar#baz');
$inactive->route('/baz', format => [qw(txt html)])->to('bar#baz');

=head2 Named routes

Expand Down Expand Up @@ -533,7 +533,7 @@ and also part of the normal router.

# * /yada.txt -> {controller => 'foo', action => 'yada', format => 'txt'}
# * /yada.json -> {controller => 'foo', action => 'yada', format => 'json'}
$r->any('/yada' => [format => ['txt', 'json']])->to('foo#yada');
$r->any('/yada' => [format => [qw(txt json)]])->to('foo#yada');

# GET /foo/bar -> {controller => 'foo', action => 'bar'}
# PUT /foo/baz -> {controller => 'foo', action => 'baz'}
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojolicious/Lite.pm
Expand Up @@ -407,7 +407,7 @@ Routes can be restricted to specific request methods.
};
# GET|POST|PATCH /bye
any ['GET', 'POST', 'PATCH'] => '/bye' => sub {
any [qw(GET POST PATCH)] => '/bye' => sub {
my $self = shift;
$self->render(text => 'Bye World!');
};
Expand Down Expand Up @@ -442,7 +442,7 @@ just make a list of possible values.
# /test
# /123
any '/:foo' => [foo => ['test', 123]] => sub {
any '/:foo' => [foo => [qw(test 123)]] => sub {
my $self = shift;
my $foo = $self->param('foo');
$self->render(text => "Our :foo placeholder matched $foo");
Expand Down Expand Up @@ -577,7 +577,7 @@ Restrictive placeholders can also be used.
# /hello.json
# /hello.txt
get '/hello' => [format => ['json', 'txt']] => sub {
get '/hello' => [format => [qw(json txt)]] => sub {
my $self = shift;
return $self->render_json({hello => 'world'})
if $self->stash('format') eq 'json';
Expand Down Expand Up @@ -835,7 +835,7 @@ L<Mojolicious::Lite> implements the following functions.
=head2 C<any>
my $route = any '/:foo' => sub {...};
my $route = any ['GET', 'POST'] => '/:foo' => sub {...};
my $route = any [qw(GET POST)] => '/:foo' => sub {...};
Generate route with L<Mojolicious::Routes::Route/"any">, matching any of the
listed HTTP request methods or all. See also the tutorial above for more
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Routes/Route.pm
Expand Up @@ -369,7 +369,7 @@ current parent if necessary.
=head2 C<any>
my $route = $r->any('/:foo' => sub {...});
my $route = $r->any(['GET', 'POST'] => '/:foo' => sub {...});
my $route = $r->any([qw(GET POST)] => '/:foo' => sub {...});
Generate route matching any of the listed HTTP request methods or all. See
also the L<Mojolicious::Lite> tutorial for more argument variations.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Types.pm
Expand Up @@ -100,7 +100,7 @@ don't really know what they actually want.
my $type = $types->type('png');
$types = $types->type(png => 'image/png');
$types = $types->type(json => ['application/json', 'text/x-json']);
$types = $types->type(json => [qw(application/json text/x-json)]);
Get or set MIME types for file extension, alternatives are only used for
detection.
Expand Down

0 comments on commit c813d75

Please sign in to comment.