From: cmzmasek@gmail.com Date: Fri, 12 Apr 2013 02:16:50 +0000 (+0000) Subject: inprogress X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8a293e9c405a3937f9d0ae598ed4408daafac644;p=jalview.git inprogress --- diff --git a/forester/ruby/evoruby/lib/evo/tool/phylogenies_decorator.rb b/forester/ruby/evoruby/lib/evo/tool/phylogenies_decorator.rb index 4e26acb..af48cc5 100644 --- a/forester/ruby/evoruby/lib/evo/tool/phylogenies_decorator.rb +++ b/forester/ruby/evoruby/lib/evo/tool/phylogenies_decorator.rb @@ -271,6 +271,7 @@ module Evoruby def get_file( files_in_dir, phylogeny_id, suffix_pattern ) matching_files = Array.new + matching_suffix_files = Array.new files_in_dir.each { | file | if ( !File.directory?( file ) && @@ -279,11 +280,22 @@ module Evoruby file =~ /^#{phylogeny_id}.*#{suffix_pattern}$/ ) matching_files << file end + if ( !File.directory?( file ) && + file !~ /^\./ && + file !~ /^00/ && + file =~ /#{suffix_pattern}$/ ) + matching_suffix_files << file + end } - if matching_files.length < 1 + if matching_files.length < 1 && matching_suffix_files.length == 1 + return matching_suffix_files[ 0 ] + end + + if matching_files.length < 1 && matching_suffix_files.length < 1 Util.fatal_error( PRG_NAME, 'no file matching [' + phylogeny_id + '_] [' + suffix_pattern + '] present in current directory' ) - elsif matching_files.length > 1 + end + if matching_files.length > 1 Util.fatal_error( PRG_NAME, 'more than one file matching [' + phylogeny_id + '_] [' + suffix_pattern + '] present in current directory' ) end