Skip to content

Commit

Permalink
Add code to get version from release date if app does not print versi…
Browse files Browse the repository at this point in the history
…on, all tests pass
  • Loading branch information
bosborne committed Sep 2, 2011
1 parent c6f898b commit 475083d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Bio/Tools/Run/Phylo/Phyml.pm
Expand Up @@ -295,6 +295,9 @@ sub program_dir {
Phyml before 3.0 did not display the version. Assume 2.44 when can not
determine it.
Some releases do not state version number, only date, so the
version has to be inferred from this date.
=cut

sub version {
Expand All @@ -304,6 +307,11 @@ sub version {
my $exe = $self->executable || return;
my $string = substr `$exe -h`, 0, 40 ;
my ($version) = $string =~ /PhyML v([\d+\.]+)/;
if ( ! $version ) {
$string =~ /PhyML\s+(\d{8})/;
# 3 was released May 2009
$version = 3 if ( $1 && $1 >= 20090501 );
}
$self->{'_version'} = $version;
$version ? (return $version) : return '2.44'
}
Expand Down

0 comments on commit 475083d

Please sign in to comment.