4
|
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;
|