Skip to content

Commit

Permalink
documentation tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 3, 2012
1 parent e54ff44 commit f00612a
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 24 deletions.
3 changes: 2 additions & 1 deletion Changes
Expand Up @@ -2380,7 +2380,8 @@ This file documents the revision history for Perl extension Mojolicious.
- Added proper home detection to Mojo itself. (charsbar)
- Fixed a bug where errors got cached in the router. (charsbar)
- Updated error handling in MojoX::Dispatcher::Static.
- Fixed Mojo::Message::Request::cookies() to always return a arrayref.
- Fixed Mojo::Message::Request::cookies() to always return an array
reference.
- Fixed url_for to support references. (vti)
- Fixed unescaping of captures. (vti)
- Fixed typos. (uwe)
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojo/Base.pm
Expand Up @@ -207,10 +207,10 @@ hash or a hash reference with attribute values.
BaseSubClass->attr([qw/name1 name2 name3/] => 'foo');
BaseSubClass->attr([qw/name1 name2 name3/] => sub {...});
Create attributes. An array can be used to create more than one attribute.
Pass an optional second argument to set a default value, it should be a
constant or a sub reference. The sub reference will be excuted at accessor
read time if there's no set value.
Create attributes. An array reference can be used to create more than one
attribute. Pass an optional second argument to set a default value, it should
be a constant or a sub reference. The sub reference will be excuted at
accessor read time if there's no set value.
=head1 DEBUGGING
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/DOM.pm
Expand Up @@ -723,7 +723,7 @@ L<Mojo::Collection> object, depending on number of children.
=head1 ELEMENT ATTRIBUTES
Direct hash access to element attributes is also possible.
Direct hash reference access to element attributes is also possible.
say $dom->{foo};
say $dom->div->{id};
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojo/Headers.pm
Expand Up @@ -352,7 +352,7 @@ Shortcut for the C<Expires> header.
$headers = $headers->from_hash({'Content-Type' => 'text/html'});
Parse headers from a hash.
Parse headers from a hash reference.
=head2 C<header>
Expand Down Expand Up @@ -526,14 +526,14 @@ Shortcut for the C<Status> header.
my $hash = $headers->to_hash;
my $hash = $headers->to_hash(1);
Format headers as a hash, nested arrays to represent multi line values are
disabled by default.
Turn headers into hash reference, nested array references to represent multi
line values are disabled by default.
=head2 C<to_string>
my $string = $headers->to_string;
Format headers suitable for HTTP 1.1 messages.
Turn headers into a string, suitable for HTTP 1.1 messages.
=head2 C<trailer>
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/JSON.pm
Expand Up @@ -355,8 +355,8 @@ L<Mojo::JSON> is a minimalistic and relaxed implementation of RFC 4627. While
it is possibly the fastest pure-Perl JSON parser available, you should not
use it for validation.
It supports normal Perl data types like C<Scalar>, C<Array>, C<Hash> and will
try to stringify blessed references.
It supports normal Perl data types like C<Scalar>, C<Array> reference,
C<Hash> reference and will try to stringify blessed references.
[1, -2, 3] -> [1, -2, 3]
{"foo": "bar"} -> {foo => 'bar'}
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Parameters.pm
Expand Up @@ -309,7 +309,7 @@ Remove parameters.
my $hash = $params->to_hash;
Turn parameters into a hashref.
Turn parameters into a hash reference.
# "baz"
Mojo::Parameters->new('foo=bar&foo=baz')->to_hash->{foo}->[1];
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -128,7 +128,7 @@ sub _config {
unless ($c = do $file) {
die qq/Can't load config file "$file": $@/ if $@;
die qq/Can't load config file "$file": $!/ unless defined $c;
die qq/Config file "$file" did not return a hashref.\n/
die qq/Config file "$file" did not return a hash reference.\n/
unless ref $c eq 'HASH';
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -756,8 +756,8 @@ C<url_for>.
This is a wrapper around L<Mojolicious::Renderer/"render"> exposing pretty
much all functionality provided by it. It will set a default template to use
based on the controller and action name or fall back to the route name. You
can call it with a hash of options which can be preceded by an optional
template name.
can call it with a hash or hash reference of options which can be preceded by
an optional template name.
=head2 C<render_content>
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Plugin/Config.pm
Expand Up @@ -28,7 +28,7 @@ sub parse {
no warnings;
die qq/Couldn't parse config file "$file": $@/
unless my $config = eval "sub app { \$app }; $content";
die qq/Config file "$file" did not return a hashref.\n/
die qq/Config file "$file" did not return a hash reference.\n/
unless (ref $config || '') eq 'HASH';

return $config;
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojolicious/Renderer.pm
Expand Up @@ -405,8 +405,8 @@ L<Mojolicious::Controller/"render"> for a more user-friendly interface.
handler => 'epl'
});
Builds a template name based on an options hash with C<template>, C<format>
and C<handler>, usually used by handlers.
Builds a template name based on an options hash reference with C<template>,
C<format> and C<handler>, usually used by handlers.
=head2 C<template_path>
Expand All @@ -416,8 +416,8 @@ and C<handler>, usually used by handlers.
handler => 'epl'
});
Builds a full template path based on an options hash with C<template>,
C<format> and C<handler>, usually used by handlers.
Builds a full template path based on an options hash reference with
C<template>, C<format> and C<handler>, usually used by handlers.
=head1 SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Routes/Match.pm
Expand Up @@ -119,7 +119,7 @@ sub path_for {
# Even
else {

# Name and hashref
# Name and hash
if (ref $_[1] eq 'HASH') { ($name, $values) = (shift, shift) }

# Just values
Expand Down
4 changes: 2 additions & 2 deletions t/mojolicious/dispatch.t
Expand Up @@ -43,7 +43,7 @@ is $c->stash('foo'), 'bar', 'set and return a stash value';

# Ref value
my $stash = $c->stash;
is_deeply $stash, {foo => 'bar'}, 'return a hashref';
is_deeply $stash, {foo => 'bar'}, 'return a hash reference';

# Replace
$c->stash(foo => 'baz');
Expand Down Expand Up @@ -74,7 +74,7 @@ is_deeply $c->stash, {}, 'elements can be deleted';
# Set via hash
$c->stash({a => 1, b => 2});
$stash = $c->stash;
is_deeply $stash, {a => 1, b => 2}, 'set via hashref';
is_deeply $stash, {a => 1, b => 2}, 'set via hash reference';

# Override captures
is $c->param('foo'), undef, 'no value';
Expand Down

0 comments on commit f00612a

Please sign in to comment.