Skip to content

Commit ed42ad0

Browse files
authored
Merge pull request #149 from okurz/fix/spew
Adapt to deprecation of spurt in upstream Mojolicious
2 parents 1aa3eef + f74ba26 commit ed42ad0

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

Makefile.PL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ WriteMakefile(
1212
ABSTRACT_FROM => 'lib/Mojolicious/Plugin/AssetPack.pm',
1313
VERSION_FROM => 'lib/Mojolicious/Plugin/AssetPack.pm',
1414
TEST_REQUIRES => {'Test::More' => '0.88'},
15-
PREREQ_PM => {'File::Which' => '1.21', 'IPC::Run3' => '0.048', 'Mojolicious' => '9.0'},
15+
PREREQ_PM => {'File::Which' => '1.21', 'IPC::Run3' => '0.048', 'Mojolicious' => '9.34'},
1616
META_MERGE => {
1717
'dynamic_config' => 0,
1818
'meta-spec' => {version => 2},

lib/Mojolicious/Plugin/AssetPack/Pipe/RollupJs.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ has _rollupjs => sub {
4646
$self->{_rollupjs_src} = tempfile(SUFFIX => '.js');
4747
}
4848

49-
$self->{_rollupjs_src}->spurt($bin);
49+
$self->{_rollupjs_src}->spew($bin);
5050

5151
return [$self->_find_app([qw(nodejs node)]), $self->{_rollupjs_src}->realpath];
5252
};

lib/Mojolicious/Plugin/AssetPack/Store.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ sub save {
139139

140140
return $self->asset_class->new(%$attrs, content => $$ref) unless -w $dir;
141141

142-
$path->spurt($$ref);
142+
$path->spew($$ref);
143143
$self->_db_set(%$attrs);
144144
return $self->asset_class->new(%$attrs, path => $path);
145145
}
@@ -288,7 +288,7 @@ sub _download {
288288
$path = path($self->paths->[0], $self->_url2path($attrs{url}, $attrs{format}));
289289
$self->_log->info(qq(Caching "$url" to "$path".));
290290
$path->dirname->make_path unless -d $path->dirname;
291-
$path->spurt($tx->res->body);
291+
$path->spew($tx->res->body);
292292
}
293293

294294
$attrs{url} = "$attrs{url}";

t/Helper.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ END { cleanup() }
1717
my %CREATED_FILES;
1818

1919
unless ($ENV{TEST_KEEP_FILES}) {
20-
my $spurt = \&Mojo::File::spurt;
20+
my $spew = \&Mojo::File::spew;
2121
Mojo::Util::monkey_patch(
22-
'Mojo::File' => spurt => sub {
22+
'Mojo::File' => spew => sub {
2323
$CREATED_FILES{$_[0]} = 1 unless -e $_[0];
24-
goto $spurt;
24+
goto $spew;
2525
}
2626
);
2727
}

t/recreate.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ my $t = t::Helper->t(pipes => [qw(Css Combine)]);
1414
my @assets = qw(one.css recreate.css);
1515
my $recreate = path(qw(t assets recreate.css));
1616

17-
$recreate->spurt(".recreate { color: #aaa }\n");
17+
$recreate->spew(".recreate { color: #aaa }\n");
1818

1919
$t->app->asset->process('app.css' => @assets);
2020

@@ -28,15 +28,15 @@ $t->get_ok('/')->status_is(200);
2828
is $t->tx->res->dom->at('link')->{href}, $link, 'same link href';
2929

3030
# recreate
31-
$recreate->spurt(".recreate { color: #bbb }\n");
31+
$recreate->spew(".recreate { color: #bbb }\n");
3232
my $tr = t::Helper->t(pipes => [qw(Css Combine)]);
3333
$tr->app->asset->process('app.css' => @assets);
3434
$tr->get_ok('/')->status_is(200);
3535
isnt $tr->tx->res->dom->at('link')->{href}, $link, 'changed link href';
3636
$tr->get_ok($tr->tx->res->dom->at('link')->{href})->status_is(200)->content_like(qr{color:\#bbb});
3737

3838
# reset asset
39-
$recreate->spurt(".recreate { color: #aaa }\n");
39+
$recreate->spew(".recreate { color: #aaa }\n");
4040

4141
done_testing;
4242
__DATA__

0 commit comments

Comments
 (0)