Skip to content

Commit

Permalink
Force configs to be created via builder.
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed Nov 20, 2016
1 parent 5742ad3 commit c701b94
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/MetaCPAN/Role/HasConfig.pm
Expand Up @@ -2,7 +2,7 @@ package MetaCPAN::Role::HasConfig;

use Moose::Role;

use FindBin qw( $RealBin );
use FindBin;
use Hash::Merge::Simple qw(merge);
use IO::Interactive qw(is_interactive);
use MetaCPAN::Types qw(HashRef);
Expand All @@ -13,17 +13,18 @@ sub config {
}

has _config => (
is => 'ro',
isa => HashRef,
lazy => 1,
builder => '_build_config',
is => 'ro',
isa => HashRef,
init_arg => undef,
lazy => 1,
builder => '_build_config',
);

sub _build_config {
my $self = shift;
my $config = Config::JFDI->new(
name => 'metacpan_server',
path => "$RealBin/..",
path => "$FindBin::RealBin/..",
)->get;

if ( $ENV{HARNESS_ACTIVE} ) {
Expand Down

0 comments on commit c701b94

Please sign in to comment.