[Bioperl-guts-l] [16455] bioperl-live/trunk/Bio/Tools/Run/WrapperBase/CommandExts.pm: bugs squish
Mark Allen Jensen
maj at dev.open-bio.org
Fri Dec 11 13:57:34 EST 2009
Revision: 16455
Author: maj
Date: 2009-12-11 13:57:33 -0500 (Fri, 11 Dec 2009)
Log Message:
-----------
bugs squish
Modified Paths:
--------------
bioperl-live/trunk/Bio/Tools/Run/WrapperBase/CommandExts.pm
Modified: bioperl-live/trunk/Bio/Tools/Run/WrapperBase/CommandExts.pm
===================================================================
--- bioperl-live/trunk/Bio/Tools/Run/WrapperBase/CommandExts.pm 2009-12-11 17:51:47 UTC (rev 16454)
+++ bioperl-live/trunk/Bio/Tools/Run/WrapperBase/CommandExts.pm 2009-12-11 18:57:33 UTC (rev 16455)
@@ -696,7 +696,7 @@
# program dir, and that the command names within the module are the
# same as the program names.
my $exereg = $self->{_pathstoexe};
- $self->throw("Program directory must be specified in wrapper configuration") unless $self->program_dir;
+ $self->throw("Program directory must be specified; use program_dir(\$path)") unless $self->program_dir;
my $dir = $self->program_dir;
my $program_path = File::Spec->catfile($dir, $cmd);
if ( -x $program_path ) { # note this allows symlinks!!!
@@ -970,15 +970,16 @@
=cut
sub AUTOLOAD {
- my $self = shift;
+ my $class = shift;
my $tok = $AUTOLOAD;
my @args = @_;
- $tok = s/.*:://;
+ $tok =~ s/.*:://;
+ unless ($tok =~ /^new_/) {
+ Bio::Root::Root->throw("Can't locate object method '$tok' via package '".ref($class)?ref($class):$class);
+ }
my ($cmd) = $tok =~ m/new_(.*)/;
- unless (grep /^$cmd$/, @{$self->{_options}->{_commands}}) {
- $self->throw("Can't locate object method '$tok' via package '".ref($self)) }
- my $pkg = ref($self);
- return $pkg->new( -command => $cmd, @args );
+ return $class->new( -command => $cmd, @args );
+
}
=head1 Bio:ParameterBaseI compliance
More information about the Bioperl-guts-l
mailing list