Skip to content

Commit

Permalink
move daemon build inside the mojo app
Browse files Browse the repository at this point in the history
This is better encapsulation, and removes a strange bit of the test.
There's something to be said about having a Statocles site as a
Mojolicious app as well.
  • Loading branch information
preaction committed Sep 9, 2015
1 parent 12b51c8 commit b21297f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/Statocles/Command.pm
Expand Up @@ -126,7 +126,6 @@ sub main {
GetOptionsFromArray( \@argv, \%build_opt,
'date|d=s',
);
$cmd->site->build( %build_opt );

require Mojo::Server::Daemon;
my $app = Statocles::Command::_MOJOAPP->new(
Expand Down Expand Up @@ -433,6 +432,9 @@ sub bundle_theme {
my ( $self ) = @_;
$self->log( $self->site->log );

# First build the site
$self->site->build( %{ $self->options } );

my $base;
if ( $self->site->base_url ) {
$base = Mojo::URL->new( $self->site->base_url )->path->to_string;
Expand Down
1 change: 0 additions & 1 deletion t/command/mojo_app.t
Expand Up @@ -15,7 +15,6 @@ my ( $tmp, $config_fn, $config ) = build_temp_site( $SHARE_DIR );
subtest 'root site' => sub {

my $site = Beam::Wire->new( file => "$config_fn" )->get( 'site' );
$site->build;

my $t = Test::Mojo->new(
Statocles::Command::_MOJOAPP->new(
Expand Down

0 comments on commit b21297f

Please sign in to comment.