Mercurial > repos > sarahinraauzeville > star
view GalaxyPath.pm @ 2:80e19490ec6a draft
Uploaded
author | sarahinraauzeville |
---|---|
date | Tue, 12 Dec 2017 10:08:56 -0500 |
parents | 1a0416feb74b |
children |
line wrap: on
line source
package GalaxyPath; use parent 'Config::IniFiles'; sub _convert_path{ my ($path)=@_; return $path if ($path=~/^\//); return "$ENV{'MY_GALAXY_DIR'}/galaxy/$path"; } sub my_path{ my $self = shift; my ($section,$item)=@_; defined $ENV{'MY_GALAXY_DIR'} || die 'no MY_GALAXY_DIR environment variable defined'; -e $ENV{'MY_GALAXY_DIR'} || die "$ENV{'MY_GALAXY_DIR'} path not found"; return join(',',map{_convert_path($_)}split/,/,$self->val($section,$item)); } 1;