[BioRuby-cvs] bioruby/lib/bio/db litdb.rb,0.5,0.6

Mitsuteru C. Nakao nakao at pub.open-bio.org
Mon Nov 7 09:28:15 EST 2005


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

Modified Files:
	litdb.rb 
Log Message:
* Converted to RDoc.


Index: litdb.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/litdb.rb,v
retrieving revision 0.5
retrieving revision 0.6
diff -C2 -d -r0.5 -r0.6
*** litdb.rb	22 Nov 2002 22:58:18 -0000	0.5
--- litdb.rb	7 Nov 2005 14:28:12 -0000	0.6
***************
*** 1,6 ****
  #
! # bio/db/litdb.rb - LITDB database class
  #
! #   Copyright (C) 2001 KATAYAMA Toshiaki <k at bioruby.org>
  #
  #  This library is free software; you can redistribute it and/or
--- 1,17 ----
  #
! # = bio/db/litdb.rb - LITDB database class
  #
! # Copyright::  Copyright (C) 2001 KATAYAMA Toshiaki <k at bioruby.org>
! # Licence::    LGPL
! #
! #  $Id$
! #
! # == Description
! #
! #
! # == Example
! # == References
! #
! #--
  #
  #  This library is free software; you can redistribute it and/or
***************
*** 18,22 ****
  #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #  $Id$
  #
  
--- 29,33 ----
  #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #++
  #
  
***************
*** 25,50 ****
  module Bio
  
    class LITDB < NCBIDB
  
!     DELIMITER	= RS = "\nEND\n"
!     TAGSIZE	= 12
  
      def initialize(entry)
        super(entry, TAGSIZE)
      end
  
      def reference
        hash = Hash.new('') 
  
!       hash['authors']	= author.split(/;/).map {|x| x.sub(/,/, ', ')}
!       hash['title']	= title 
!       hash['journal']	= journal.gsub(/\./, '. ').strip
  
        vol = volume.split(/,\s+/)
        if vol.size > 1
!         hash['volume']	= vol.shift.sub(/Vol\./, '')
          hash['pages'],
!         hash['year']	= vol.pop.split(' ')
!         hash['issue']	= vol.shift.sub(/No\./, '') unless vol.empty?
        end
  
--- 36,70 ----
  module Bio
  
+   # = LITDB class
    class LITDB < NCBIDB
  
!     # Delimiter
!     DELIMITER = "\nEND\n"
  
+     # Delimiter
+     RS = DELIMITER
+ 
+     #
+     TAGSIZE = 12
+ 
+     #
      def initialize(entry)
        super(entry, TAGSIZE)
      end
  
+     # Returns
      def reference
        hash = Hash.new('') 
  
!       hash['authors'] = author.split(/;/).map {|x| x.sub(/,/, ', ')}
!       hash['title']   = title 
!       hash['journal'] = journal.gsub(/\./, '. ').strip
  
        vol = volume.split(/,\s+/)
        if vol.size > 1
!         hash['volume'] = vol.shift.sub(/Vol\./, '')
          hash['pages'],
!         hash['year'] = vol.pop.split(' ')
!         hash['issue'] = vol.shift.sub(/No\./, '') unless vol.empty?
        end
  
***************
*** 110,130 ****
    p Bio::LITDB.new(entry).reference
  end
- 
- 
- =begin
- 
- = Bio::LITDB
- 
- --- Bio::LITDB.new(entry)
- --- Bio::LITDB#reference
- --- Bio::LITDB#entry_id
- --- Bio::LITDB#title
- --- Bio::LITDB#field
- --- Bio::LITDB#journal
- --- Bio::LITDB#volume
- --- Bio::LITDB#keyword
- --- Bio::LITDB#author
- 
- =end
- 
- 
--- 130,131 ----



More information about the bioruby-cvs mailing list