Skip to content

Commit a934fd9

Browse files
committed
fixes for newer Mojolicious
1 parent eae8986 commit a934fd9

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

bootylicious

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ use FindBin;
44
use Cwd;
55
use lib "$FindBin::Bin/lib";
66
use Mojolicious::Lite;
7-
use Mojo::Util qw(md5_sum spurt);
7+
use Mojo::Util qw(md5_sum);
8+
use Mojo::File qw(path);
9+
use Mojo::Home;
810
use Mojo::Loader qw(data_section);
911
use Bootylicious;
1012
use Bootylicious::Timestamp;
1113

12-
app->home->parse($ENV{BOOTYLICIOUS_HOME} || getcwd());
14+
app->home(Mojo::Home->new($ENV{BOOTYLICIOUS_HOME} || getcwd()));
1315

1416
unshift @{app->plugins->namespaces}, 'Bootylicious::Plugin';
1517

@@ -25,7 +27,7 @@ if (@ARGV && $ARGV[0] eq '--create-config') {
2527
die "bootylicious.conf already exists\n";
2628
}
2729

28-
spurt(data_section(__PACKAGE__, 'bootylicious.conf'), 'bootylicious.conf');
30+
path('bootylicious.conf')->spurt(data_section(__PACKAGE__, 'bootylicious.conf'));
2931
exit;
3032
}
3133

lib/Bootylicious/Plugin/BootyConfig.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ sub register {
6262
$ENV{LC_ALL} = 'C';
6363

6464
# set proper templates base dir, if defined
65-
push @{$app->renderer->paths}, $app->home->rel_dir($config->{templates_directory})
65+
push @{$app->renderer->paths}, $app->home->rel_file($config->{templates_directory})
6666
if defined $config->{templates_directory};
6767

6868
# set proper public base dir, if defined
69-
push @{$app->static->paths}, $app->home->rel_dir($config->{public_directory})
69+
push @{$app->static->paths}, $app->home->rel_file($config->{public_directory})
7070
if defined $config->{public_directory};
7171

7272
$app->defaults(title => '', description => '', layout => 'wrapper');

lib/Bootylicious/Plugin/BootyHelpers.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ sub register {
280280
my $option = $config->{"${name}_directory"} || '';
281281
$app->helper(
282282
"${name}_root" => sub {
283-
($option =~ m/^\//) ? $option : $app->home->rel_dir($option);
283+
($option =~ m/^\//) ? $option : $app->home->rel_file($option);
284284
}
285285
);
286286
}

0 commit comments

Comments
 (0)