Skip to content

Commit

Permalink
document more boolean attribute values
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 20, 2013
1 parent 8107e06 commit 492cdb7
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 48 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

4.50 2013-10-20
4.50 2013-10-21
- Removed deprecated attrs method from Mojo::DOM.
- Improved Mojo::Message to allow max_message_size check to be disabled.
- Fixed small assignment bug in content helper.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Asset/File.pm
Expand Up @@ -176,8 +176,8 @@ implements the following new ones.
=head2 cleanup
my $cleanup = $file->cleanup;
$file = $file->cleanup(1);
my $bool = $file->cleanup;
$file = $file->cleanup($bool);
Delete file automatically once it's not used anymore.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Asset/Memory.pm
Expand Up @@ -99,8 +99,8 @@ implements the following new ones.
=head2 auto_upgrade
my $upgrade = $mem->auto_upgrade;
$mem = $mem->auto_upgrade(1);
my $bool = $mem->auto_upgrade;
$mem = $mem->auto_upgrade($bool);
Try to detect if content size exceeds C<max_memory_size> limit and
automatically upgrade to a L<Mojo::Asset::File> object.
Expand Down
12 changes: 6 additions & 6 deletions lib/Mojo/Content.pm
Expand Up @@ -380,8 +380,8 @@ L<Mojo::Content> implements the following attributes.
=head2 auto_relax
my $relax = $content->auto_relax;
$content = $content->auto_relax(1);
my $bool = $content->auto_relax;
$content = $content->auto_relax($bool);
Try to detect when relaxed parsing is necessary.
Expand Down Expand Up @@ -410,16 +410,16 @@ value of the MOJO_MAX_LEFTOVER_SIZE environment variable or C<262144>.
=head2 relaxed
my $relaxed = $content->relaxed;
$content = $content->relaxed(1);
my $bool = $content->relaxed;
$content = $content->relaxed($bool);
Activate relaxed parsing for responses that are terminated with a connection
close.
=head2 skip_body
my $skip = $content->skip_body;
$content = $content->skip_body(1);
my $bool = $content->skip_body;
$content = $content->skip_body($bool);
Skip body parsing and finish after headers.
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojo/Cookie/Response.pm
Expand Up @@ -116,8 +116,8 @@ Cookie domain.
=head2 httponly
my $httponly = $cookie->httponly;
$cookie = $cookie->httponly(1);
my $bool = $cookie->httponly;
$cookie = $cookie->httponly($bool);
HttpOnly flag, which can prevent client-side scripts from accessing this
cookie.
Expand Down Expand Up @@ -145,8 +145,8 @@ Cookie path.
=head2 secure
my $secure = $cookie->secure;
$cookie = $cookie->secure(1);
my $bool = $cookie->secure;
$cookie = $cookie->secure($bool);
Secure flag, which instructs browsers to only send this cookie over HTTPS
connections.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/DOM.pm
Expand Up @@ -768,8 +768,8 @@ Element type.
=head2 xml
my $xml = $dom->xml;
$dom = $dom->xml(1);
my $bool = $dom->xml;
$dom = $dom->xml($bool);
Disable HTML semantics in parser and activate case sensitivity, defaults to
auto detection based on processing instructions.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/DOM/HTML.pm
Expand Up @@ -342,8 +342,8 @@ carefully since it is very dynamic.
=head2 xml
my $xml = $html->xml;
$html = $html->xml(1);
my $bool = $html->xml;
$html = $html->xml($bool);
Disable HTML semantics in parser and activate case sensitivity, defaults to
auto detection based on processing instructions.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Exception.pm
Expand Up @@ -167,8 +167,8 @@ Exception message.
=head2 verbose
my $verbose = $e->verbose;
$e = $e->verbose(1);
my $bool = $e->verbose;
$e = $e->verbose($bool);
Render exception with context.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Server/CGI.pm
Expand Up @@ -114,8 +114,8 @@ implements the following new ones.
=head2 nph
my $nph = $cgi->nph;
$cgi = $cgi->nph(1);
my $bool = $cgi->nph;
$cgi = $cgi->nph($bool);
Activate non-parsed header mode.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Server/Daemon.pm
Expand Up @@ -435,8 +435,8 @@ Maximum number of keep-alive requests per connection, defaults to C<25>.
=head2 silent
my $silent = $daemon->silent;
$daemon = $daemon->silent(1);
my $bool = $daemon->silent;
$daemon = $daemon->silent($bool);
Disable console messages.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Template.pm
Expand Up @@ -454,8 +454,8 @@ L<Mojo::Template> implements the following attributes.
=head2 auto_escape
my $escape = $mt->auto_escape;
$mt = $mt->auto_escape(1);
my $bool = $mt->auto_escape;
$mt = $mt->auto_escape($bool);
Activate automatic escaping.
Expand Down
3 changes: 2 additions & 1 deletion lib/Mojo/Transaction.pm
Expand Up @@ -193,7 +193,8 @@ implements the following new ones.
$tx->client_close;
$tx->client_close(1);
Transaction closed client-side, used to implement user agents.
Transaction closed client-side, no actual connection close is assumed by
default, used to implement user agents.
=head2 client_read
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Transaction/WebSocket.pm
Expand Up @@ -453,8 +453,8 @@ object.
=head2 masked
my $masked = $ws->masked;
$ws = $ws->masked(1);
my $bool = $ws->masked;
$ws = $ws->masked($bool);
Mask outgoing frames with XOR cipher and a random 32bit key.
Expand Down
16 changes: 6 additions & 10 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -70,27 +70,22 @@ sub detect_proxy {
}

sub need_proxy {
my ($self, $host) = @_;
return !first { $host =~ /\Q$_\E$/ } @{$self->no_proxy || []};
!first { $_[1] =~ /\Q$_\E$/ } @{$_[0]->no_proxy || []};
}

sub start {
my ($self, $tx, $cb) = @_;

# Fork safety
unless (($self->{pid} //= $$) eq $$) {
$self->_cleanup;
delete @$self{qw(pid port)};
}
delete @{$self->_cleanup}{qw(pid port)} unless ($self->{pid} //= $$) eq $$;

# Non-blocking
if ($cb) {
warn "-- Non-blocking request (@{[$tx->req->url->to_abs]})\n" if DEBUG;
unless ($self->{nb}) {
croak 'Blocking request in progress' if keys %{$self->{connections}};
warn "-- Switching to non-blocking mode\n" if DEBUG;
$self->_cleanup;
$self->{nb}++;
$self->_cleanup->{nb}++;
}
return $self->_start($tx, $cb);
}
Expand All @@ -100,8 +95,7 @@ sub start {
if ($self->{nb}) {
croak 'Non-blocking requests in progress' if keys %{$self->{connections}};
warn "-- Switching to blocking mode\n" if DEBUG;
$self->_cleanup;
delete $self->{nb};
delete $self->_cleanup->{nb};
}
$self->_start($tx => sub { shift->ioloop->stop; $tx = shift });
$self->ioloop->start;
Expand Down Expand Up @@ -158,6 +152,8 @@ sub _cleanup {

# Stop server
delete $self->{server};

return $self;
}

sub _connect {
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Command.pm
Expand Up @@ -147,8 +147,8 @@ Short description of command, used for the command list.
=head2 quiet
my $quiet = $command->quiet;
$command = $command->quiet(1);
my $bool = $command->quiet;
$command = $command->quiet($bool);
Limited command output.
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojolicious/Routes/Route.pm
Expand Up @@ -279,8 +279,8 @@ The children of this route, used for nesting routes.
=head2 inline
my $inline = $r->inline;
$r = $r->inline(1);
my $bool = $r->inline;
$r = $r->inline($bool);
Allow C<bridge> semantics for this route.
Expand All @@ -293,8 +293,8 @@ The parent of this route, used for nesting routes.
=head2 partial
my $partial = $r->partial;
$r = $r->partial(1);
my $bool = $r->partial;
$r = $r->partial($bool);
Route has no specific end, remaining characters will be captured in C<path>.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Sessions.pm
Expand Up @@ -129,8 +129,8 @@ C<expiration> and C<expires> session values.
=head2 secure
my $secure = $sessions->secure;
$sessions = $sessions->secure(1);
my $bool = $sessions->secure;
$sessions = $sessions->secure($bool);
Set the secure flag on all session cookies, so that browsers send them only
over HTTPS connections.
Expand Down

0 comments on commit 492cdb7

Please sign in to comment.