annotate GalaxyPath.pm @ 4:71f57a90f530 draft

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