Mercurial > repos > sarahinraauzeville > star
comparison GalaxyPath.pm @ 0:1a0416feb74b draft
Uploaded
author | sarahinraauzeville |
---|---|
date | Tue, 12 Dec 2017 10:08:05 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1a0416feb74b |
---|---|
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; |