Skip to content

Commit

Permalink
better oneliner examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 5, 2012
1 parent 33a16d1 commit 483aa0d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

2.99 2012-06-04
2.99 2012-06-05
- Improved message parser performance slightly.
- Improved documentation.
- Improved tests.
Expand Down
3 changes: 1 addition & 2 deletions lib/Mojo/DOM/CSS.pm
Expand Up @@ -195,8 +195,7 @@ sub _equation {

# Equation
elsif ($equation =~ /(?:(-?(?:\d+)?)?(n))?\s*\+?\s*(-?\s*\d+)?\s*$/i) {
$num->[0] = $1;
$num->[0] = $2 ? 1 : 0 unless defined($num->[0]) && length($num->[0]);
$num->[0] = defined($1) && length($1) ? $1 : $2 ? 1 : 0;
$num->[0] = -1 if $num->[0] eq '-';
$num->[1] = $3 // 0;
$num->[1] =~ s/\s+//g;
Expand Down
4 changes: 2 additions & 2 deletions lib/ojo.pm
Expand Up @@ -89,13 +89,13 @@ L<ojo> implements the following functions.
=head2 C<a>
my $app = a('/' => sub { shift->render(json => {hello => 'world'}) });
my $app = a('/hello' => sub { shift->render(json => {hello => 'world'}) });
Create a route with L<Mojolicious::Lite/"any"> and return the current
L<Mojolicious::Lite> object. See also the L<Mojolicious::Lite> tutorial for
more argument variations.
$ perl -Mojo -E 'a("/" => {text => "Hello Mojo!"})->start' daemon
$ perl -Mojo -E 'a("/hello" => {text => "Hello Mojo!"})->start' daemon
=head2 C<b>
Expand Down

0 comments on commit 483aa0d

Please sign in to comment.