comparison GalaxyPath.pm @ 4:71f57a90f530 draft

Uploaded
author sarahinraauzeville
date Tue, 12 Dec 2017 09:40:37 -0500
parents
children
comparison
equal deleted inserted replaced
3:bcc062005bb2 4:71f57a90f530
1 package GalaxyPath;
2
3 use parent 'Config::IniFiles';
4
5 sub _convert_path{
6 my ($path)=@_;
7 return $path if ($path=~/^\//);
8 return "$ENV{'MY_GALAXY_DIR'}/galaxy/$path";
9 }
10
11 sub my_path{
12 my $self = shift;
13 my ($section,$item)=@_;
14 defined $ENV{'MY_GALAXY_DIR'} || die 'no MY_GALAXY_DIR environment variable defined';
15 -e $ENV{'MY_GALAXY_DIR'} || die "$ENV{'MY_GALAXY_DIR'} path not found";
16 return join(',',map{_convert_path($_)}split/,/,$self->val($section,$item));
17 }
18
19 1;