to pass test configurations as json files
use strict;
use warnings;
use Moo;
use MooX::Options;
use IPC::Run qw/run new_chunker/;
use File::Which;
use IO::All;
use JSON;
use DDP;
use Carp;
use Try::T
=> 'rw',
required => 1,
format => 's@',
doc =>
'Test option: one ore more json file(s) containing the casperjs tests to perform'
);
option 'casper_path' => (
is =>
my $content = io($file)->slurp;
try {
$ret->{$file} = decode_json($content);
}
catch {
carp "'$file' is not valid: $_";
e App::DeDuppy;
# ABSTRACT: generate json files from casperjs test arguments
use strict;
use warnings;
use 5.010;
use Carp;
use Moo;
use MooX::Options;
use JSON;
option 'arglist' => (is => 'ro',
default => sub { [] });
sub truthify_maybe {
$_[0] eq 'false' ? JSON::false :
$_[0] eq 'true' ? JSON::true : $_[0];
}
sub arrayrefify_maybe {
my @values = split(/,/, $_[0]
$+{value});
$self->options->{$option} = defined $value ? arrayrefify_maybe($value) : JSON::true;
} else {
if ($self->subcommand_is_set) {
push @{$se