# HG changeset patch # User sarahinraauzeville # Date 1513091285 18000 # Node ID 1a0416feb74b94d38b99dc4f28baa16dffe9f42b Uploaded diff -r 000000000000 -r 1a0416feb74b GalaxyPath.pm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GalaxyPath.pm Tue Dec 12 10:08:05 2017 -0500 @@ -0,0 +1,19 @@ +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;