Skip to content

Commit

Permalink
fixed formatting with latest perltidy
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 12, 2014
1 parent c31bc24 commit 858b412
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 38 deletions.
4 changes: 3 additions & 1 deletion lib/Mojo/Collection.pm
Expand Up @@ -52,7 +52,9 @@ sub grep {
return $self->new(grep { $_ =~ $cb } @$self);
}

sub join { Mojo::ByteStream->new(join $_[1] // '', map({"$_"} @{$_[0]})) }
sub join {
Mojo::ByteStream->new(join $_[1] // '', map {"$_"} @{$_[0]});
}

sub last { shift->[-1] }

Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/UserAgent/CookieJar.pm
Expand Up @@ -25,7 +25,7 @@ sub add {
next unless my $path = $cookie->path;
next unless length(my $name = $cookie->name // '');
my $jar = $self->{jar}{$domain} ||= [];
@$jar = (grep({_compare($_, $path, $name, $origin)} @$jar), $cookie);
@$jar = (grep({ _compare($_, $path, $name, $origin) } @$jar), $cookie);
}

return $self;
Expand Down
72 changes: 36 additions & 36 deletions t/mojolicious/command.t
@@ -1,36 +1,36 @@
use Mojo::Base -strict;

BEGIN { $ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll' }

use Test::More;
use Cwd 'cwd';
use File::Spec::Functions 'catdir';
use File::Temp 'tempdir';
use Mojolicious::Command;

# Application
my $command = Mojolicious::Command->new;
isa_ok $command->app, 'Mojo', 'right application';
isa_ok $command->app, 'Mojolicious', 'right application';

# Generating files
my $cwd = cwd;
my $dir = tempdir CLEANUP => 1;
chdir $dir;
$command->create_rel_dir('foo/bar');
ok -d catdir(qw(foo bar)), 'directory exists';
my $template = "@@ foo_bar\njust <%= 'works' %>!\n";
open my $data, '<', \$template;
no strict 'refs';
*{"Mojolicious::Command::DATA"} = $data;
$command->render_to_rel_file('foo_bar', 'bar/baz.txt');
open my $txt, '<', $command->rel_file('bar/baz.txt');
is join('', <$txt>), "just works!\n", 'right result';
$command->chmod_rel_file('bar/baz.txt', 0700);
ok -e $command->rel_file('bar/baz.txt'), 'file is executable';
$command->write_rel_file('123.xml', "seems\nto\nwork");
open my $xml, '<', $command->rel_file('123.xml');
is join('', <$xml>), "seems\nto\nwork", 'right result';
chdir $cwd;

done_testing();
use Mojo::Base -strict;

BEGIN { $ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll' }

use Test::More;
use Cwd 'cwd';
use File::Spec::Functions 'catdir';
use File::Temp 'tempdir';
use Mojolicious::Command;

# Application
my $command = Mojolicious::Command->new;
isa_ok $command->app, 'Mojo', 'right application';
isa_ok $command->app, 'Mojolicious', 'right application';

# Generating files
my $cwd = cwd;
my $dir = tempdir CLEANUP => 1;
chdir $dir;
$command->create_rel_dir('foo/bar');
ok -d catdir(qw(foo bar)), 'directory exists';
my $template = "@@ foo_bar\njust <%= 'works' %>!\n";
open my $data, '<', \$template;
no strict 'refs';
*{"Mojolicious::Command::DATA"} = $data;
$command->render_to_rel_file('foo_bar', 'bar/baz.txt');
open my $txt, '<', $command->rel_file('bar/baz.txt');
is join('', <$txt>), "just works!\n", 'right result';
$command->chmod_rel_file('bar/baz.txt', 0700);
ok -e $command->rel_file('bar/baz.txt'), 'file is executable';
$command->write_rel_file('123.xml', "seems\nto\nwork");
open my $xml, '<', $command->rel_file('123.xml');
is join('', <$xml>), "seems\nto\nwork", 'right result';
chdir $cwd;

done_testing();

0 comments on commit 858b412

Please sign in to comment.