P;
$App::JESP::VERSION = '0.016';
use Moose;
use App::JESP::Plan;
use App::JESP::Colorizer;
use JSON;
use Class::Load;
use DBI;
use DBIx::Simple;
use File::Spec;
use IO::Interactive;
use Log::Any qw
( is => 'ro', isa => 'App::JESP::Colorizer', lazy_build => 1 );
has json => ( is => "ro", lazy_build => 1 );
sub _build_json { JSON->new->relaxed(1) }
sub _build_driver{
my ($self) = @_;
ret
}
sub _build_plan{
my ($self) = @_;
my $file = File::Spec->catfile( $self->home(), 'plan.json' );
unless( ( -e $file ) && ( -r $file ) ){
die "File $file does not exists or is not
' ]
);
}
sub abstract { "Deploy patches from <home>/plan.json in the DB" }
sub description { "Deploys patches from <home>/plan.json in the DB and records their applications in the Meta tables" }
$app ) = @_;
return (
[ 'home=s' =>
"The home directory where the plan.json lives" ],
[ 'dsn=s' =>
"The DSN to connect to the DB. See https://metacpan.
($self) = @_;
my $content = File::Slurp::read_file( $self->file() );
return $self->jesp->json->decode( $content );
}
sub _build_patches{
my ($self) = @_;
unless( $self->raw_data()->{