From 57e0f201ef8ec8e48eb253148d7514b11735cf74 Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Sat, 16 Nov 2013 00:50:11 +0000 Subject: [PATCH] inprogress --- .../evoruby/lib/evo/tool/phylogenies_decorator.rb | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/forester/ruby/evoruby/lib/evo/tool/phylogenies_decorator.rb b/forester/ruby/evoruby/lib/evo/tool/phylogenies_decorator.rb index c9f37ae..ae2d980 100644 --- a/forester/ruby/evoruby/lib/evo/tool/phylogenies_decorator.rb +++ b/forester/ruby/evoruby/lib/evo/tool/phylogenies_decorator.rb @@ -242,27 +242,21 @@ 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 ) && file !~ /^\./ && file !~ /^00/ && - file =~ /^#{phylogeny_id}.*#{suffix_pattern}$/ ) + 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 && matching_suffix_files.length == 1 - return matching_suffix_files[ 0 ] - end + - if matching_files.length < 1 && matching_suffix_files.length < 1 + if matching_files.length < 1 Util.fatal_error( PRG_NAME, 'no file matching [' + phylogeny_id + '_] [' + suffix_pattern + '] present in current directory' ) end -- 1.7.10.2