[BioRuby-cvs] bioruby/lib/bio db.rb,0.30,0.31

Katayama Toshiaki k at pub.open-bio.org
Wed Dec 7 06:23:53 EST 2005


Update of /home/repository/bioruby/bioruby/lib/bio
In directory pub.open-bio.org:/tmp/cvs-serv28253/lib/bio

Modified Files:
	db.rb 
Log Message:
* fixed to check empty or incomplete string (e.g. empty entry)


Index: db.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db.rb,v
retrieving revision 0.30
retrieving revision 0.31
diff -C2 -d -r0.30 -r0.31
*** db.rb	30 Oct 2005 17:15:05 -0000	0.30
--- db.rb	7 Dec 2005 11:23:51 -0000	0.31
***************
*** 211,226 ****
    # space and stripeed.
    def truncate(str)
!     return str.gsub(/\s+/, ' ').strip
    end
  
    # Returns a tag name of the field as a String.
    def tag_get(str)
!     return str[0, at tagsize].strip
    end
  
    # Returns a String of the field without a tag name.
    def tag_cut(str)
!     str[0, at tagsize] = ''
!     return str
    end
  
--- 211,237 ----
    # space and stripeed.
    def truncate(str)
!     if str
!       str.gsub(/\s+/, ' ').strip
!     else
!       ""
!     end
    end
  
    # Returns a tag name of the field as a String.
    def tag_get(str)
!     if str
!       str[0, at tagsize].strip
!     else
!       ""
!     end
    end
  
    # Returns a String of the field without a tag name.
    def tag_cut(str)
!     if str
!       str[0, at tagsize] = ''
!     else
!       ""
!     end
    end
  



More information about the bioruby-cvs mailing list