Skip to content

Commit

Permalink
improved a few synopsis examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 28, 2012
1 parent f2a87b1 commit 8b4e42a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
13 changes: 8 additions & 5 deletions lib/Mojo/Date.pm
Expand Up @@ -76,10 +76,13 @@ Mojo::Date - HTTP date
use Mojo::Date;
my $date = Mojo::Date->new(784111777);
my $http_date = $date->to_string;
$date->parse('Sun, 06 Nov 1994 08:49:37 GMT');
my $epoch = $date->epoch;
# Parse
my $date = Mojo::Date->new('Sun, 06 Nov 1994 08:49:37 GMT');
say $date->epoch;
# Build
my $date = Mojo::Date->new(time);
say "$date";
=head1 DESCRIPTION
Expand Down Expand Up @@ -109,7 +112,7 @@ following new ones.
=head2 C<new>
my $date = Mojo::Date->new;
my $date = Mojo::Date->new($string);
my $date = Mojo::Date->new('Sun Nov 6 08:49:37 1994');
Construct a new L<Mojo::Date> object.
Expand Down
7 changes: 5 additions & 2 deletions lib/Mojo/Home.pm
Expand Up @@ -90,7 +90,6 @@ sub parse {
}

sub rel_dir { catdir(@{shift->{parts} || []}, split '/', shift) }

sub rel_file { catfile(@{shift->{parts} || []}, split '/', shift) }

sub slurp_rel_file { slurp shift->rel_file(@_) }
Expand All @@ -101,14 +100,18 @@ sub to_string { catdir(@{shift->{parts} || []}) }

=head1 NAME
Mojo::Home - Detect and access the project root directory in Mojo
Mojo::Home - Home sweet home!
=head1 SYNOPSIS
use Mojo::Home;
# Find and manage the project root directory
my $home = Mojo::Home->new;
$home->detect;
say $home->lib_dir;
say $home->rel_file('templates/layouts/default.html.ep');
say "$home";
=head1 DESCRIPTION
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Parameters.pm
Expand Up @@ -277,7 +277,7 @@ Clone parameters.
$p = $p->merge(Mojo::Parameters->new(foo => 'b;ar', baz => 23));
Merge parameters.
Merge L<Mojo::Parameters> objects.
=head2 C<param>
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/UserAgent/Transactor.pm
Expand Up @@ -79,7 +79,7 @@ sub form {
my $req = $tx->req;
my $headers = $req->headers;
$headers->content_type('multipart/form-data') if $multipart;
if (($headers->content_type || '') eq 'multipart/form-data') {
if ($headers->content_type ~~ 'multipart/form-data') {
my $parts = $self->_multipart($encoding, $p->to_hash);
$req->content(
Mojo::Content::MultiPart->new(headers => $headers, parts => $parts));
Expand Down

0 comments on commit 8b4e42a

Please sign in to comment.