Permalink
Browse files

switch from 78 to 79 characters

  • Loading branch information...
1 parent 2558de5 commit 97eae381b3cd1017ab90482d3cb9cc4c3671a32e @kraih committed Apr 19, 2012
Showing with 589 additions and 695 deletions.
  1. +1 −1 .perltidyrc
  2. +3 −4 lib/Mojo.pm
  3. +1 −2 lib/Mojo/Asset/File.pm
  4. +4 −4 lib/Mojo/Asset/Memory.pm
  5. +2 −2 lib/Mojo/Content.pm
  6. +2 −2 lib/Mojo/Content/MultiPart.pm
  7. +2 −2 lib/Mojo/Content/Single.pm
  8. +4 −4 lib/Mojo/DOM.pm
  9. +3 −4 lib/Mojo/DOM/CSS.pm
  10. +2 −2 lib/Mojo/Date.pm
  11. +1 −2 lib/Mojo/Headers.pm
  12. +16 −19 lib/Mojo/IOLoop.pm
  13. +2 −5 lib/Mojo/IOLoop/Server.pm
  14. +5 −5 lib/Mojo/IOLoop/Stream.pm
  15. +5 −6 lib/Mojo/JSON.pm
  16. +3 −3 lib/Mojo/JSON/Pointer.pm
  17. +5 −6 lib/Mojo/Message.pm
  18. +19 −19 lib/Mojo/Message/Response.pm
  19. +2 −2 lib/Mojo/Parameters.pm
  20. +2 −2 lib/Mojo/Server.pm
  21. +2 −2 lib/Mojo/Server/CGI.pm
  22. +5 −5 lib/Mojo/Server/Daemon.pm
  23. +9 −9 lib/Mojo/Server/Hypnotoad.pm
  24. +8 −8 lib/Mojo/Server/Morbo.pm
  25. +2 −2 lib/Mojo/Server/PSGI.pm
  26. +7 −8 lib/Mojo/Template.pm
  27. +1 −2 lib/Mojo/Upload.pm
  28. +8 −9 lib/Mojo/UserAgent.pm
  29. +2 −2 lib/Mojo/Util.pm
  30. +10 −10 lib/Mojolicious.pm
  31. +2 −2 lib/Mojolicious/Command/cgi.pm
  32. +2 −2 lib/Mojolicious/Command/cpanify.pm
  33. +2 −2 lib/Mojolicious/Command/daemon.pm
  34. +2 −2 lib/Mojolicious/Command/generate/makefile.pm
  35. +2 −2 lib/Mojolicious/Command/inflate.pm
  36. +2 −2 lib/Mojolicious/Commands.pm
  37. +10 −13 lib/Mojolicious/Controller.pm
  38. +4 −4 lib/Mojolicious/Guides.pod
  39. +10 −10 lib/Mojolicious/Guides/CodingGuidelines.pod
  40. +49 −51 lib/Mojolicious/Guides/Cookbook.pod
  41. +24 −26 lib/Mojolicious/Guides/FAQ.pod
  42. +28 −30 lib/Mojolicious/Guides/Growing.pod
  43. +30 −32 lib/Mojolicious/Guides/Rendering.pod
  44. +21 −22 lib/Mojolicious/Guides/Routing.pod
  45. +19 −20 lib/Mojolicious/Lite.pm
  46. +2 −2 lib/Mojolicious/Plugin.pm
  47. +3 −3 lib/Mojolicious/Plugin/Config.pm
  48. +3 −3 lib/Mojolicious/Plugin/DefaultHelpers.pm
  49. +4 −4 lib/Mojolicious/Plugin/EPLRenderer.pm
  50. +2 −2 lib/Mojolicious/Plugin/EPRenderer.pm
  51. +3 −3 lib/Mojolicious/Plugin/HeaderCondition.pm
  52. +4 −4 lib/Mojolicious/Plugin/I18N.pm
  53. +2 −2 lib/Mojolicious/Plugin/Mount.pm
  54. +2 −3 lib/Mojolicious/Plugin/PODRenderer.pm
  55. +2 −2 lib/Mojolicious/Plugin/RequestTimer.pm
  56. +5 −6 lib/Mojolicious/Plugin/TagHelpers.pm
  57. +4 −4 lib/Mojolicious/Renderer.pm
  58. +3 −3 lib/Mojolicious/Sessions.pm
  59. +4 −4 lib/Mojolicious/Static.pm
  60. +8 −8 lib/Test/Mojo.pm
  61. +11 −14 t/mojo/bytestream.t
  62. +1 −2 t/mojo/collection.t
  63. +10 −13 t/mojo/cookie.t
  64. +16 −18 t/mojo/dom.t
  65. +22 −25 t/mojo/headers.t
  66. +7 −8 t/mojo/home.t
  67. +1 −2 t/mojo/ioloop.t
  68. +1 −2 t/mojo/ioloop_tls.t
  69. +3 −6 t/mojo/json.t
  70. +1 −2 t/mojo/parameters.t
  71. +1 −2 t/mojo/path.t
  72. +1 −2 t/mojo/reactor_ev.t
  73. +2 −4 t/mojo/reactor_poll.t
  74. +25 −28 t/mojo/request.t
  75. +2 −4 t/mojo/request_cgi.t
  76. +11 −12 t/mojo/response.t
  77. +2 −4 t/mojo/template.t
  78. +25 −31 t/mojo/transactor.t
  79. +9 −16 t/mojo/url.t
  80. +4 −8 t/mojolicious/app.t
  81. +1 −2 t/mojolicious/embedded_app.t
  82. +2 −4 t/mojolicious/embedded_lite_app.t
  83. +2 −2 t/mojolicious/exception_lite_app.t
  84. +4 −6 t/mojolicious/group_lite_app.t
  85. +3 −9 t/mojolicious/layouted_lite_app.t
  86. +1 −2 t/mojolicious/lib/MojoliciousTest.pm
  87. +12 −22 t/mojolicious/lite_app.t
  88. +1 −2 t/mojolicious/pattern.t
  89. +6 −9 t/mojolicious/restful_lite_app.t
  90. +4 −6 t/mojolicious/routes.t
  91. +2 −2 t/mojolicious/websocket_lite_app.t
View
@@ -2,7 +2,7 @@
-b # Just rewrite the file
-w # Show all warnings
-iob # Ignore old breakpoints
--l=78 # 78 character per line
+-l=79 # 79 character per line
-mbl=2 # No more than 2 blank lines
-i=2 # Indent level is 2
-ci=2 # Continuation indent is 2
View
@@ -144,8 +144,7 @@ new ones.
my $app = Mojo->new;
Construct a new L<Mojo> application. Will automatically detect your home
-directory and set up logging to C<log/mojo.log> if there's a C<log>
-directory.
+directory and set up logging to C<log/mojo.log> if there's a C<log> directory.
=head2 C<build_tx>
@@ -174,8 +173,8 @@ Application configuration.
The handler is the main entry point to your application or framework and will
be called for each new transaction, which will usually be a
-L<Mojo::Transaction::HTTP> or L<Mojo::Transaction::WebSocket> object. Meant
-to be overloaded in a subclass.
+L<Mojo::Transaction::HTTP> or L<Mojo::Transaction::WebSocket> object. Meant to
+be overloaded in a subclass.
sub handler {
my ($self, $tx) = @_;
View
@@ -25,8 +25,7 @@ has handle => sub {
my $base = File::Spec->catfile($self->tmpdir, 'mojo.tmp');
my $name = $path // $base;
until ($handle->open($name, O_CREAT | O_EXCL | O_RDWR)) {
- croak qq/Can't open file "$name": $!/
- if defined $path || $! != $!{EEXIST};
+ croak qq/Can't open file "$name": $!/ if defined $path || $! != $!{EEXIST};
$name = "$base." . md5_sum(time . $$ . rand 9999999);
}
$self->path($name);
View
@@ -113,14 +113,14 @@ automatically upgrade to a L<Mojo::Asset::File> object.
my $size = $mem->max_memory_size;
$mem = $mem->max_memory_size(1024);
-Maximum size in bytes of data to keep in memory before automatically
-upgrading to a L<Mojo::Asset::File> object, defaults to the value of the
+Maximum size in bytes of data to keep in memory before automatically upgrading
+to a L<Mojo::Asset::File> object, defaults to the value of the
C<MOJO_MAX_MEMORY_SIZE> environment variable or C<262144>.
=head1 METHODS
-L<Mojo::Asset::Memory> inherits all methods from L<Mojo::Asset> and
-implements the following new ones.
+L<Mojo::Asset::Memory> inherits all methods from L<Mojo::Asset> and implements
+the following new ones.
=head2 C<new>
View
@@ -458,8 +458,8 @@ value of the C<MOJO_MAX_LEFTOVER_SIZE> environment variable or C<262144>.
my $relaxed = $content->relaxed;
$content = $content->relaxed(1);
-Activate relaxed parsing for HTTP 0.9 and responses that are terminated with
-a connection close.
+Activate relaxed parsing for HTTP 0.9 and responses that are terminated with a
+connection close.
=head1 METHODS
@@ -266,8 +266,8 @@ Emitted when a new L<Mojo::Content::Single> part starts.
=head1 ATTRIBUTES
-L<Mojo::Content::MultiPart> inherits all attributes from L<Mojo::Content>
-and implements the following new ones.
+L<Mojo::Content::MultiPart> inherits all attributes from L<Mojo::Content> and
+implements the following new ones.
=head2 C<parts>
@@ -131,8 +131,8 @@ implements the following new ones.
my $single = Mojo::Content::Single->new;
-Construct a new L<Mojo::Content::Single> object and subscribe to C<read>
-event with default content parser.
+Construct a new L<Mojo::Content::Single> object and subscribe to C<read> event
+with default content parser.
=head2 C<body_contains>
View
@@ -469,8 +469,8 @@ are lowercased and selectors need to be lowercase as well.
say $dom->at('p')->text;
say $dom->p->{id};
-If XML processing instructions are found, the parser will automatically
-switch into XML mode and everything becomes case sensitive.
+If XML processing instructions are found, the parser will automatically switch
+into XML mode and everything becomes case sensitive.
my $dom = Mojo::DOM->new('<?xml version="1.0"?><P ID="greeting">Hi!</P>');
say $dom->at('P')->text;
@@ -568,8 +568,8 @@ Render content of this element to XML.
my $collection = $dom->find('html title');
-Find elements with CSS3 selectors and return a L<Mojo::Collection> object.
-All selectors from L<Mojo::DOM::CSS> are supported.
+Find elements with CSS3 selectors and return a L<Mojo::Collection> object. All
+selectors from L<Mojo::DOM::CSS> are supported.
# Find a specific element and extract information
my $id = $dom->find('div')->[23]{id};
View
@@ -150,8 +150,7 @@ sub _compile {
while ($element =~ /$CLASS_ID_RE/g) {
# Class
- push @$selector, ['attr', 'class', $self->_regex('~', $1)]
- if defined $1;
+ push @$selector, ['attr', 'class', $self->_regex('~', $1)] if defined $1;
# ID
push @$selector, ['attr', 'id', $self->_regex('', $2)] if defined $2;
@@ -466,8 +465,8 @@ An C<E> element, root of the document.
=head2 C<E:checked>
-A user interface element C<E> which is checked (for instance a radio-button
-or checkbox).
+A user interface element C<E> which is checked (for instance a radio-button or
+checkbox).
my $input = $css->select(':checked');
View
@@ -84,8 +84,8 @@ Mojo::Date - HTTP 1.1 date container
=head1 DESCRIPTION
-L<Mojo::Date> implements HTTP 1.1 date and time functions according to
-RFC 2616.
+L<Mojo::Date> implements HTTP 1.1 date and time functions according to RFC
+2616.
Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
View
@@ -163,8 +163,7 @@ sub to_string {
# Format multiline values
my @headers;
for my $name (@{$self->names}) {
- push @headers, "$name: " . join("\x0d\x0a ", @$_)
- for $self->header($name);
+ push @headers, "$name: " . join("\x0d\x0a ", @$_) for $self->header($name);
}
# Format headers
View
@@ -343,14 +343,13 @@ L<Mojo::IOLoop> is a very minimalistic reactor based on L<Mojo::Reactor>, it
has been reduced to the absolute minimal feature set required to build solid
and scalable non-blocking TCP clients and servers.
-Optional modules L<EV>, L<IO::Socket::IP> and L<IO::Socket::SSL> are
-supported transparently and used if installed. Individual features can also
-be disabled with the C<MOJO_NO_IPV6> and C<MOJO_NO_TLS> environment
-variables.
+Optional modules L<EV>, L<IO::Socket::IP> and L<IO::Socket::SSL> are supported
+transparently and used if installed. Individual features can also be disabled
+with the C<MOJO_NO_IPV6> and C<MOJO_NO_TLS> environment variables.
-A TLS certificate and key are also built right in to make writing test
-servers as easy as possible. Also note that for convenience the C<PIPE>
-signal will be set to C<IGNORE> when L<Mojo::IOLoop> is loaded.
+A TLS certificate and key are also built right in to make writing test servers
+as easy as possible. Also note that for convenience the C<PIPE> signal will be
+set to C<IGNORE> when L<Mojo::IOLoop> is loaded.
=head1 ATTRIBUTES
@@ -369,10 +368,9 @@ defaults to L<Mojo::IOLoop::Client>.
my $cb = $loop->lock;
$loop = $loop->lock(sub {...});
-A locking callback that decides if this loop is allowed to accept new
-incoming connections, used to sync multiple server processes. The callback
-should return true or false. Note that exceptions in this callback are not
-captured.
+A locking callback that decides if this loop is allowed to accept new incoming
+connections, used to sync multiple server processes. The callback should
+return true or false. Note that exceptions in this callback are not captured.
$loop->lock(sub {
my ($loop, $blocking) = @_;
@@ -399,8 +397,7 @@ connections indefinitely.
The maximum number of parallel connections this loop is allowed to handle
before stopping to accept new incoming connections, defaults to C<1000>.
Setting the value to C<0> will make this loop stop accepting new connections
-and allow it to shutdown gracefully without interrupting existing
-connections.
+and allow it to shutdown gracefully without interrupting existing connections.
=head2 C<reactor>
@@ -467,8 +464,8 @@ L<Mojo::IOLoop::Client/"connect">.
my $delay = $loop->delay;
my $delay = $loop->delay(sub {...});
-Get L<Mojo::IOLoop::Delay> object to synchronize events and subscribe to
-event L<Mojo::IOLoop::Delay/"finish"> if optional callback is provided.
+Get L<Mojo::IOLoop::Delay> object to synchronize events and subscribe to event
+L<Mojo::IOLoop::Delay/"finish"> if optional callback is provided.
# Synchronize multiple events
my $delay = Mojo::IOLoop->delay(sub { say 'BOOM!' });
@@ -555,8 +552,8 @@ object from everywhere inside the process.
Mojo::IOLoop->start;
$loop->start;
-Start the loop, this will block until C<stop> is called or no events are
-being watched anymore.
+Start the loop, this will block until C<stop> is called or no events are being
+watched anymore.
# Start loop only if it is not running already
Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
@@ -591,8 +588,8 @@ seconds.
=head1 DEBUGGING
-You can set the C<MOJO_IOLOOP_DEBUG> environment variable to get some
-advanced diagnostics information printed to C<STDERR>.
+You can set the C<MOJO_IOLOOP_DEBUG> environment variable to get some advanced
+diagnostics information printed to C<STDERR>.
MOJO_IOLOOP_DEBUG=1
@@ -143,11 +143,8 @@ sub listen {
}
sub generate_port {
- IO::Socket::INET->new(
- Listen => 5,
- LocalAddr => '127.0.0.1',
- Proto => 'tcp'
- )->sockport;
+ IO::Socket::INET->new(Listen => 5, LocalAddr => '127.0.0.1', Proto => 'tcp')
+ ->sockport;
}
sub start {
View
@@ -275,9 +275,9 @@ global L<Mojo::IOLoop> singleton.
my $timeout = $stream->timeout;
$stream = $stream->timeout(45);
-Maximum amount of time in seconds stream can be inactive before getting
-closed automatically, defaults to C<15>. Setting the value to C<0> will allow
-this stream to be inactive indefinitely.
+Maximum amount of time in seconds stream can be inactive before getting closed
+automatically, defaults to C<15>. Setting the value to C<0> will allow this
+stream to be inactive indefinitely.
=head1 METHODS
@@ -306,8 +306,8 @@ Get handle for stream.
my $success = $stream->is_readable;
-Quick non-blocking check if stream is readable, useful for identifying
-tainted sockets.
+Quick non-blocking check if stream is readable, useful for identifying tainted
+sockets.
=head2 C<is_writing>
View
@@ -266,8 +266,7 @@ sub _encode_string {
my $string = shift;
# Escape string
- $string
- =~ s|([\x00-\x1F\x7F\x{2028}\x{2029}\\"/\b\f\n\r\t])|$REVERSE{$1}|gs;
+ $string =~ s|([\x00-\x1F\x7F\x{2028}\x{2029}\\"/\b\f\n\r\t])|$REVERSE{$1}|gs;
# Stringify
return "\"$string\"";
@@ -349,11 +348,11 @@ Mojo::JSON - Minimalistic JSON
=head1 DESCRIPTION
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 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> reference,
-C<Hash> reference 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'}
View
@@ -50,16 +50,16 @@ Mojo::JSON::Pointer - JSON Pointers
=head1 DESCRIPTION
L<Mojo::JSON::Pointer> implements JSON Pointers as described in
-L<http://tools.ietf.org/html/draft-pbryan-zyp-json-pointer-02>.
+L<http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer>.
=head1 METHODS
=head2 C<contains>
my $success = $p->contains($data, '/foo/1');
-Check if data structure contains a value that can be identified with the
-given JSON Pointer.
+Check if data structure contains a value that can be identified with the given
+JSON Pointer.
# True
$p->contains({foo => 'bar', baz => [4, 5, 6]}, '/foo');
View
@@ -50,8 +50,7 @@ sub body {
# Callback
if (ref $new eq 'CODE') {
weaken $self;
- return $content->unsubscribe('read')
- ->on(read => sub { $self->$new(pop) });
+ return $content->unsubscribe('read')->on(read => sub { $self->$new(pop) });
}
# Set text content
@@ -543,8 +542,8 @@ L<Mojo::DOM>.
my $class = $message->json_class;
$message = $message->json_class('Mojo::JSON');
-Class to be used for JSON deserialization with the C<json> method, defaults
-to L<Mojo::JSON>.
+Class to be used for JSON deserialization with the C<json> method, defaults to
+L<Mojo::JSON>.
=head2 C<max_message_size>
@@ -737,8 +736,8 @@ Alias for L<Mojo::Content/"is_multipart">.
my $value = $message->json('/foo/bar');
Decode JSON message body directly using L<Mojo::JSON> if possible, returns
-C<undef> otherwise. An optional JSON Pointer can be used to extract a
-specific value with L<Mojo::JSON::Pointer>.
+C<undef> otherwise. An optional JSON Pointer can be used to extract a specific
+value with L<Mojo::JSON::Pointer>.
say $message->json->{foo}{bar}[23];
say $message->json('/foo/bar/23');
Oops, something went wrong.

0 comments on commit 97eae38

Please sign in to comment.