X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fruby%2Fevoruby%2Flib%2Fevo%2Futil%2Futil.rb;h=e4173d326c1aa2fe4e12abcc592866cbff95b734;hb=2044a46819969b8ac56d653aab5729fb782ec40c;hp=79f92e0bbb895334fbf66ae7961b1d86ba9189da;hpb=d03733a9998b73a5880b9dab0f688e6a69661019;p=jalview.git diff --git a/forester/ruby/evoruby/lib/evo/util/util.rb b/forester/ruby/evoruby/lib/evo/util/util.rb index 79f92e0..e4173d3 100644 --- a/forester/ruby/evoruby/lib/evo/util/util.rb +++ b/forester/ruby/evoruby/lib/evo/util/util.rb @@ -14,8 +14,12 @@ module Evoruby class Util - def Util.normalize_seq_name( name, length ) + def Util.normalize_seq_name( name, length, exception_if_too_long = false ) if name.length > length + if exception_if_too_long + error_msg = "sequence name \"#{name}\" is too long (>#{length})" + raise StandardError, error_msg + end name = name[ 0, length ] elsif name.length < length for i in 0 ... length - name.length