App-Sqitch

 view release on metacpan or  search on metacpan

lib/App/Sqitch/Command/verify.pm  view on Meta::CPAN

package App::Sqitch::Command::verify;

use 5.010;
use strict;
use warnings;
use utf8;
use Moo;
use Types::Standard qw(Str HashRef);
use App::Sqitch::X qw(hurl);
use Locale::TextDomain qw(App-Sqitch);
use List::Util qw(first);
use namespace::autoclean;

extends 'App::Sqitch::Command';
with 'App::Sqitch::Role::ContextCommand';
with 'App::Sqitch::Role::ConnectingCommand';

our $VERSION = 'v1.6.1'; # VERSION

has target => (
    is  => 'ro',
    isa => Str,
);

has from_change => (
    is  => 'ro',
    isa => Str,
);

has to_change => (
    is  => 'ro',
    isa => Str,
);

has variables => (
    is       => 'ro',
    isa      => HashRef,
    lazy     => 1,
    default  => sub { {} },
);

sub options {
    return qw(
        target|t=s
        from-change|from=s
        to-change|to=s
        set|s=s%
    );
}

sub configure {
    my ( $class, $config, $opt ) = @_;

    my %params = map {
        $_ => $opt->{$_}
    } grep {
        exists $opt->{$_}
    } qw(target from_change to_change);

    if ( my $vars = $opt->{set} ) {
        $params{variables} = $vars;
    }

    return \%params;
}

sub _collect_vars {
    my ($self, $target) = @_;
    my $cfg = $self->sqitch->config;
    return (
        %{ $cfg->get_section(section => 'core.variables') },
        %{ $cfg->get_section(section => 'deploy.variables') },



( run in 0.601 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )