Bio-VertRes-Config

 view release on metacpan or  search on metacpan

lib/Bio/VertRes/Config/MultipleTopLevelFiles.pm  view on Meta::CPAN

# ABSTRACT: A class to represent multiple top level files. It splits out mixed config files into the correct top level files


use Moose;
use Bio::VertRes::Config::TopLevel;

has 'database'         => ( is => 'ro', isa => 'Str',      required => 1 );
has 'pipeline_configs' => ( is => 'ro', isa => 'ArrayRef', required => 1 );
has 'config_base'  => ( is => 'ro', isa => 'Str',     required => 1 );

sub update_or_create {
    my ($self) = @_;

    my %short_name_to_configs;

    # split by short name
    for my $pipeline_config ( @{ $self->pipeline_configs } ) {
        # Create the config file
        $pipeline_config->create_config_file;
        if ( !defined( $short_name_to_configs{ $pipeline_config->pipeline_short_name } ) ) {
            $short_name_to_configs{ $pipeline_config->pipeline_short_name } = [];

lib/Bio/VertRes/Config/TopLevel.pm  view on Meta::CPAN

    
    return \%filenames_to_action;
}

# The file needs to be read before overwriting it
before 'update_or_create' => sub { 
  my ($self) = @_;
  $self->_filenames_to_action; 
};

sub update_or_create {
    my ($self) = @_;
    
    my $mode = 0777;
    # Make sure the directory structure exists before creating the file
    if(!(-e $self->overall_config))
    {
      my($overall_config_filename, $directories, $suffix) = fileparse($self->overall_config);
      make_path($directories, { mode => $mode });
    }

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.072 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )