| 1 | package Test::BDD::Infrastructure::Config::Facter; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | # ABSTRACT: configuration class for Test::BDD::Infrastructure | ||||||||||
| 6 | 1 | our $VERSION = '1.005'; # VERSION | |||||||||
| 7 | |||||||||||
| 8 | 1 | extends 'Test::BDD::Infrastructure::Config::Hash'; | |||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use IPC::Run; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 1 | ▶ | use JSON; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | has 'command' => ( is => 'ro', isa => 'ArrayRef[Str]', | ||||||||||
| 14 | 0 | ▶ | default => sub { [ 'facter', '--json' ] }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 15 | 1 | ); | |||||||||
| 16 | |||||||||||
| 17 | has 'config' => ( is => 'rw', lazy => 1, isa => 'HashRef', | ||||||||||
| 18 | 0 | ▶ | default => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 19 | 0 | my $self = shift; | |||||||||
| 20 | 0 | my ( $in, $out, $err ); | |||||||||
| 21 | 0 | ▶ | IPC::Run::run($self->command, \$in, \$out, \$err ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | or die("error running facter: $err"); | ||||||||||
| 23 | 0 | my $data = from_json( $out ); | |||||||||
| 24 | 0 | return( $data ); | |||||||||
| 25 | }, | ||||||||||
| 26 | 1 | ); | |||||||||
| 27 | |||||||||||
| 28 | 1 | 1; | |||||||||
| 29 | |||||||||||
| 30 | __END__ | ||||||||||