[BioRuby-cvs] bioruby/lib/bio/io flatfile.rb,1.48,1.49

Naohisa Goto ngoto at pub.open-bio.org
Wed Mar 22 10:19:24 UTC 2006


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

Modified Files:
	flatfile.rb 
Log Message:
Bio::FlatFile did not work correctly for pipes.
Bio::FlatFile#entry_start_pos and #entry_ended_pos are changed to be enabled
only when Bio::FlatFile#entry_pos_flag is true.


Index: flatfile.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/io/flatfile.rb,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** flatfile.rb	3 Mar 2006 09:31:57 -0000	1.48
--- flatfile.rb	22 Mar 2006 10:19:22 -0000	1.49
***************
*** 262,265 ****
--- 262,268 ----
          attr_reader :entry
  
+         # a flag to write down entry start and end positions
+         attr_accessor :entry_pos_flag
+ 
          # start position of the entry
          attr_reader :entry_start_pos
***************
*** 290,293 ****
--- 293,297 ----
            end
            @delimiter_overrun = klass::DELIMITER_OVERRUN rescue nil
+           @entry_pos_flag = nil
          end
  
***************
*** 330,334 ****
          # gets a entry
          def get_entry
!           p0 = @stream.pos
            e  = @stream.gets(@delimiter)
            if e and @delimiter_overrun then
--- 334,338 ----
          # gets a entry
          def get_entry
!           p0 = @entry_pos_flag ? @stream.pos : nil
            e  = @stream.gets(@delimiter)
            if e and @delimiter_overrun then
***************
*** 339,343 ****
              end
            end
!           p1 = @stream.pos
            @entry_start_pos = p0
            @entry = e
--- 343,347 ----
              end
            end
!           p1 = @entry_pos_flag ? @stream.pos : nil
            @entry_start_pos = p0
            @entry = e
***************
*** 585,588 ****
--- 589,602 ----
      def entry_raw
        @splitter.entry
+     end
+ 
+     # a flag to write down entry start and end positions
+     def entry_pos_flag
+       @splitter.entry_pos_flag
+     end
+ 
+     # Sets flag to write down entry start and end positions
+     def entry_pos_flag=(x)
+       @splitter.entry_pos_flag = x
      end
  




More information about the bioruby-cvs mailing list