From 536cdf903a3c3908c117efd554d33117d91452f4 Mon Sep 17 00:00:00 2001 From: Naohisa Goto Date: Mon, 1 Sep 2008 19:05:50 +0900 Subject: [PATCH 1/5] Changed test class name because of name conflict of Bio::TestEMBL --- test/unit/bio/db/embl/test_embl_rel89.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/bio/db/embl/test_embl_rel89.rb b/test/unit/bio/db/embl/test_embl_rel89.rb index 7c0ce509c..6b6a63043 100644 --- a/test/unit/bio/db/embl/test_embl_rel89.rb +++ b/test/unit/bio/db/embl/test_embl_rel89.rb @@ -16,7 +16,7 @@ require 'bio/db/embl/embl' module Bio - class TestEMBL < Test::Unit::TestCase + class TestEMBL89 < Test::Unit::TestCase def setup bioruby_root = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 5)).cleanpath.to_s From 0fe1e7d3ed02185632f4a34d8efe1f21f755b289 Mon Sep 17 00:00:00 2001 From: Naohisa Goto Date: Mon, 1 Sep 2008 19:11:40 +0900 Subject: [PATCH 2/5] To prevent possible test class name conflicts about restriction enzyme * Tests about restriction enzyme are moved under a new module Bio::TestRestrictionEnzyme to prevent possible name conflict. * Conflicted test class names are changed. --- .../restriction_enzyme/analysis/test_calculated_cuts.rb | 6 +++--- .../util/restriction_enzyme/analysis/test_cut_ranges.rb | 6 +++--- .../restriction_enzyme/analysis/test_sequence_range.rb | 6 +++--- .../double_stranded/test_aligned_strands.rb | 6 +++--- .../double_stranded/test_cut_location_pair.rb | 6 +++--- .../test_cut_location_pair_in_enzyme_notation.rb | 6 +++--- .../double_stranded/test_cut_locations.rb | 6 +++--- .../test_cut_locations_in_enzyme_notation.rb | 6 +++--- .../test_cut_locations_in_enzyme_notation.rb | 6 +++--- test/unit/bio/util/restriction_enzyme/test_analysis.rb | 6 +++--- test/unit/bio/util/restriction_enzyme/test_cut_symbol.rb | 8 ++++---- .../bio/util/restriction_enzyme/test_double_stranded.rb | 6 +++--- .../bio/util/restriction_enzyme/test_single_strand.rb | 6 +++--- .../restriction_enzyme/test_single_strand_complement.rb | 6 +++--- .../bio/util/restriction_enzyme/test_string_formatting.rb | 6 +++--- test/unit/bio/util/test_restriction_enzyme.rb | 6 +++--- 16 files changed, 49 insertions(+), 49 deletions(-) diff --git a/test/unit/bio/util/restriction_enzyme/analysis/test_calculated_cuts.rb b/test/unit/bio/util/restriction_enzyme/analysis/test_calculated_cuts.rb index 1937773a4..ccfe6df23 100644 --- a/test/unit/bio/util/restriction_enzyme/analysis/test_calculated_cuts.rb +++ b/test/unit/bio/util/restriction_enzyme/analysis/test_calculated_cuts.rb @@ -5,7 +5,7 @@ # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) # License:: The Ruby License # -# $Id: test_calculated_cuts.rb,v 1.4 2007/04/05 23:35:44 trevor Exp $ +# $Id:$ # require 'pathname' @@ -19,7 +19,7 @@ require 'bio/util/restriction_enzyme/range/horizontal_cut_range' require 'bio/util/restriction_enzyme/range/vertical_cut_range' -module Bio #:nodoc: +module Bio; module TestRestrictionEnzyme #:nodoc: class TestAnalysisCalculatedCuts < Test::Unit::TestCase #:nodoc: @@ -296,4 +296,4 @@ def test_strands_for_display end -end +end; end diff --git a/test/unit/bio/util/restriction_enzyme/analysis/test_cut_ranges.rb b/test/unit/bio/util/restriction_enzyme/analysis/test_cut_ranges.rb index 67af1964e..3854a048e 100644 --- a/test/unit/bio/util/restriction_enzyme/analysis/test_cut_ranges.rb +++ b/test/unit/bio/util/restriction_enzyme/analysis/test_cut_ranges.rb @@ -5,7 +5,7 @@ # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) # License:: The Ruby License # -# $Id: test_cut_ranges.rb,v 1.2 2007/04/05 23:35:44 trevor Exp $ +# $Id:$ # require 'pathname' @@ -21,7 +21,7 @@ require 'bio/util/restriction_enzyme/range/vertical_cut_range' require 'bio/util/restriction_enzyme/range/cut_ranges' -module Bio #:nodoc: +module Bio; module TestRestrictionEnzyme #:nodoc: class TestCutRanges < Test::Unit::TestCase #:nodoc: @@ -100,4 +100,4 @@ def test_obj_3 assert_equal(false, @obj_3.include?(6)) end end -end \ No newline at end of file +end; end diff --git a/test/unit/bio/util/restriction_enzyme/analysis/test_sequence_range.rb b/test/unit/bio/util/restriction_enzyme/analysis/test_sequence_range.rb index e7b48d99a..71c2d2471 100644 --- a/test/unit/bio/util/restriction_enzyme/analysis/test_sequence_range.rb +++ b/test/unit/bio/util/restriction_enzyme/analysis/test_sequence_range.rb @@ -5,7 +5,7 @@ # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) # License:: The Ruby License # -# $Id: test_sequence_range.rb,v 1.4 2007/04/05 23:35:44 trevor Exp $ +# $Id:$ # require 'pathname' @@ -21,7 +21,7 @@ require 'bio/util/restriction_enzyme/range/vertical_cut_range' require 'bio/util/restriction_enzyme/range/cut_ranges' -module Bio #:nodoc: +module Bio; module TestRestrictionEnzyme #:nodoc: class TestAnalysisSequenceRange < Test::Unit::TestCase #:nodoc: @@ -237,4 +237,4 @@ def test_fragments_for_display_10 end end -end +end; end diff --git a/test/unit/bio/util/restriction_enzyme/double_stranded/test_aligned_strands.rb b/test/unit/bio/util/restriction_enzyme/double_stranded/test_aligned_strands.rb index 0e65ff59b..750f8a3d9 100644 --- a/test/unit/bio/util/restriction_enzyme/double_stranded/test_aligned_strands.rb +++ b/test/unit/bio/util/restriction_enzyme/double_stranded/test_aligned_strands.rb @@ -5,7 +5,7 @@ # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) # License:: The Ruby License # -# $Id: test_aligned_strands.rb,v 1.4 2008/06/13 11:37:25 ngoto Exp $ +# $Id:$ # require 'pathname' @@ -17,7 +17,7 @@ require 'bio/util/restriction_enzyme/double_stranded/aligned_strands' require 'bio/util/restriction_enzyme/double_stranded' -module Bio #:nodoc: +module Bio; module TestRestrictionEnzyme #:nodoc: class TestDoubleStrandedAlignedStrands < Test::Unit::TestCase #:nodoc: @@ -98,4 +98,4 @@ def test_argument_error end -end +end; end diff --git a/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair.rb b/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair.rb index d094f0aae..a918cb3ac 100644 --- a/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair.rb +++ b/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair.rb @@ -5,7 +5,7 @@ # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) # License:: The Ruby License # -# $Id: test_cut_location_pair.rb,v 1.3 2007/04/05 23:35:44 trevor Exp $ +# $Id:$ # require 'pathname' @@ -15,7 +15,7 @@ require 'test/unit' require 'bio/util/restriction_enzyme/double_stranded/cut_location_pair' -module Bio #:nodoc: +module Bio; module TestRestrictionEnzyme #:nodoc: class TestDoubleStrandedCutLocationPair < Test::Unit::TestCase #:nodoc: @@ -72,4 +72,4 @@ def test_argument_error end -end +end; end diff --git a/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair_in_enzyme_notation.rb b/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair_in_enzyme_notation.rb index 2771bed12..3a968bfc4 100644 --- a/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair_in_enzyme_notation.rb +++ b/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair_in_enzyme_notation.rb @@ -5,7 +5,7 @@ # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) # License:: The Ruby License # -# $Id: test_cut_location_pair_in_enzyme_notation.rb,v 1.3 2007/04/05 23:35:44 trevor Exp $ +# $Id:$ # require 'pathname' @@ -15,7 +15,7 @@ require 'test/unit' require 'bio/util/restriction_enzyme/double_stranded/cut_location_pair_in_enzyme_notation' -module Bio #:nodoc: +module Bio; module TestRestrictionEnzyme #:nodoc: class TestDoubleStrandedCutLocationPairInEnzymeNotation < Test::Unit::TestCase #:nodoc: @@ -70,4 +70,4 @@ def test_argument_error end -end +end; end diff --git a/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations.rb b/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations.rb index 598bff8f3..1776c2a6d 100644 --- a/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations.rb +++ b/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations.rb @@ -5,7 +5,7 @@ # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) # License:: The Ruby License # -# $Id: test_cut_locations.rb,v 1.3 2007/04/05 23:35:44 trevor Exp $ +# $Id:$ # require 'pathname' @@ -15,7 +15,7 @@ require 'test/unit' require 'bio/util/restriction_enzyme/double_stranded/cut_locations' -module Bio #:nodoc: +module Bio; module TestRestrictionEnzyme #:nodoc: class TestDoubleStrandedCutLocations < Test::Unit::TestCase #:nodoc: @@ -50,4 +50,4 @@ def test_complement end -end +end; end diff --git a/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations_in_enzyme_notation.rb b/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations_in_enzyme_notation.rb index b702d5af6..ce8d12668 100644 --- a/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations_in_enzyme_notation.rb +++ b/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations_in_enzyme_notation.rb @@ -5,7 +5,7 @@ # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) # License:: The Ruby License # -# $Id: test_cut_locations_in_enzyme_notation.rb,v 1.3 2007/04/05 23:35:44 trevor Exp $ +# $Id:$ # require 'pathname' @@ -15,7 +15,7 @@ require 'test/unit' require 'bio/util/restriction_enzyme/double_stranded/cut_locations_in_enzyme_notation' -module Bio #:nodoc: +module Bio; module TestRestrictionEnzyme #:nodoc: class TestDoubleStrandedCutLocationsInEnzymeNotation < Test::Unit::TestCase #:nodoc: @@ -101,4 +101,4 @@ def test_to_array_index_class end -end +end; end diff --git a/test/unit/bio/util/restriction_enzyme/single_strand/test_cut_locations_in_enzyme_notation.rb b/test/unit/bio/util/restriction_enzyme/single_strand/test_cut_locations_in_enzyme_notation.rb index fc5324dde..016375cdc 100644 --- a/test/unit/bio/util/restriction_enzyme/single_strand/test_cut_locations_in_enzyme_notation.rb +++ b/test/unit/bio/util/restriction_enzyme/single_strand/test_cut_locations_in_enzyme_notation.rb @@ -5,7 +5,7 @@ # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) # License:: The Ruby License # -# $Id: test_cut_locations_in_enzyme_notation.rb,v 1.3 2007/04/05 23:35:44 trevor Exp $ +# $Id:$ # require 'pathname' @@ -15,7 +15,7 @@ require 'test/unit' require 'bio/util/restriction_enzyme/single_strand/cut_locations_in_enzyme_notation' -module Bio #:nodoc: +module Bio; module TestRestrictionEnzyme #:nodoc: class TestSingleStrandCutLocationsInEnzymeNotation < Test::Unit::TestCase #:nodoc: @@ -80,4 +80,4 @@ def test_argument_error end -end +end; end diff --git a/test/unit/bio/util/restriction_enzyme/test_analysis.rb b/test/unit/bio/util/restriction_enzyme/test_analysis.rb index 5295c6a8f..d904e361a 100644 --- a/test/unit/bio/util/restriction_enzyme/test_analysis.rb +++ b/test/unit/bio/util/restriction_enzyme/test_analysis.rb @@ -5,7 +5,7 @@ # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) # License:: The Ruby License # -# $Id: test_analysis.rb,v 1.13 2007/07/16 19:29:32 k Exp $ +# $Id:$ # require 'pathname' @@ -16,7 +16,7 @@ require 'bio/util/restriction_enzyme/analysis' require 'bio/sequence' -module Bio #:nodoc: +module Bio; module TestRestrictionEnzyme #:nodoc: class TestAnalysis < Test::Unit::TestCase #:nodoc: @@ -243,4 +243,4 @@ def test_view_ranges end -end +end; end diff --git a/test/unit/bio/util/restriction_enzyme/test_cut_symbol.rb b/test/unit/bio/util/restriction_enzyme/test_cut_symbol.rb index b3525cfa1..a5eaab280 100644 --- a/test/unit/bio/util/restriction_enzyme/test_cut_symbol.rb +++ b/test/unit/bio/util/restriction_enzyme/test_cut_symbol.rb @@ -5,7 +5,7 @@ # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) # License:: The Ruby License # -# $Id: test_cut_symbol.rb,v 1.2 2007/04/05 23:35:44 trevor Exp $ +# $Id:$ # require 'pathname' @@ -15,9 +15,9 @@ require 'test/unit' require 'bio/util/restriction_enzyme/cut_symbol' -module Bio #:nodoc: +module Bio; module TestRestrictionEnzyme #:nodoc: -class TestStringFormatting < Test::Unit::TestCase #:nodoc: +class TestCutSymbol < Test::Unit::TestCase #:nodoc: include Bio::RestrictionEnzyme::CutSymbol @@ -41,4 +41,4 @@ def test_methods end -end +end; end diff --git a/test/unit/bio/util/restriction_enzyme/test_double_stranded.rb b/test/unit/bio/util/restriction_enzyme/test_double_stranded.rb index 889d62ec5..23e669365 100644 --- a/test/unit/bio/util/restriction_enzyme/test_double_stranded.rb +++ b/test/unit/bio/util/restriction_enzyme/test_double_stranded.rb @@ -5,7 +5,7 @@ # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) # License:: The Ruby License # -# $Id: test_double_stranded.rb,v 1.6 2007/07/16 19:29:32 k Exp $ +# $Id:$ # require 'pathname' @@ -16,7 +16,7 @@ require 'bio/util/restriction_enzyme/double_stranded' require 'bio/sequence' -module Bio #:nodoc: +module Bio; module TestRestrictionEnzyme #:nodoc: class TestDoubleStranded < Test::Unit::TestCase #:nodoc: @@ -112,4 +112,4 @@ def test_to_re end -end +end; end diff --git a/test/unit/bio/util/restriction_enzyme/test_single_strand.rb b/test/unit/bio/util/restriction_enzyme/test_single_strand.rb index 8508bfabc..c642cb5b3 100644 --- a/test/unit/bio/util/restriction_enzyme/test_single_strand.rb +++ b/test/unit/bio/util/restriction_enzyme/test_single_strand.rb @@ -5,7 +5,7 @@ # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) # License:: The Ruby License # -# $Id: test_single_strand.rb,v 1.3 2007/04/05 23:35:44 trevor Exp $ +# $Id:$ # require 'pathname' @@ -15,7 +15,7 @@ require 'test/unit' require 'bio/util/restriction_enzyme/single_strand' -module Bio #:nodoc: +module Bio; module TestRestrictionEnzyme #:nodoc: class TestSingleStrand < Test::Unit::TestCase #:nodoc: @@ -144,4 +144,4 @@ def test_argument_error end -end +end; end diff --git a/test/unit/bio/util/restriction_enzyme/test_single_strand_complement.rb b/test/unit/bio/util/restriction_enzyme/test_single_strand_complement.rb index 2a15c1b84..02234e73b 100644 --- a/test/unit/bio/util/restriction_enzyme/test_single_strand_complement.rb +++ b/test/unit/bio/util/restriction_enzyme/test_single_strand_complement.rb @@ -5,7 +5,7 @@ # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) # License:: The Ruby License # -# $Id: test_single_strand_complement.rb,v 1.3 2007/04/05 23:35:44 trevor Exp $ +# $Id:$ # require 'pathname' @@ -15,7 +15,7 @@ require 'test/unit' require 'bio/util/restriction_enzyme/single_strand_complement' -module Bio #:nodoc: +module Bio; module TestRestrictionEnzyme #:nodoc: class TestSingleStrandComplement < Test::Unit::TestCase #:nodoc: @@ -144,4 +144,4 @@ def test_argument_error end -end +end; end diff --git a/test/unit/bio/util/restriction_enzyme/test_string_formatting.rb b/test/unit/bio/util/restriction_enzyme/test_string_formatting.rb index 1d183303e..ebb1e03cd 100644 --- a/test/unit/bio/util/restriction_enzyme/test_string_formatting.rb +++ b/test/unit/bio/util/restriction_enzyme/test_string_formatting.rb @@ -5,7 +5,7 @@ # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) # License:: The Ruby License # -# $Id: test_string_formatting.rb,v 1.3 2007/04/05 23:35:44 trevor Exp $ +# $Id:$ # require 'pathname' @@ -15,7 +15,7 @@ require 'test/unit' require 'bio/util/restriction_enzyme/string_formatting' -module Bio #:nodoc: +module Bio; module TestRestrictionEnzyme #:nodoc: class TestStringFormatting < Test::Unit::TestCase #:nodoc: @@ -57,4 +57,4 @@ def test_add_spacing end -end +end; end diff --git a/test/unit/bio/util/test_restriction_enzyme.rb b/test/unit/bio/util/test_restriction_enzyme.rb index 12ec4745a..d4b832b04 100644 --- a/test/unit/bio/util/test_restriction_enzyme.rb +++ b/test/unit/bio/util/test_restriction_enzyme.rb @@ -5,7 +5,7 @@ # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) # License:: The Ruby License # -# $Id: test_restriction_enzyme.rb,v 1.3 2007/04/05 23:35:44 trevor Exp $ +# $Id:$ # require 'pathname' @@ -15,7 +15,7 @@ require 'test/unit' require 'bio/util/restriction_enzyme.rb' -module Bio #:nodoc: +module Bio; module TestRestrictionEnzyme #:nodoc: class TestRestrictionEnzyme < Test::Unit::TestCase #:nodoc: @@ -39,4 +39,4 @@ def test_enzyme_name end -end +end; end From 64cc5ef6f2d949cc9193b08dfc3fde6b221950d7 Mon Sep 17 00:00:00 2001 From: Michael Barton Date: Mon, 1 Sep 2008 14:59:38 +0100 Subject: [PATCH 3/5] Added code to pull estimated tree from codeml report --- lib/bio/appl/paml/codeml/report.rb | 7 ++++++- test/unit/bio/appl/paml/codeml/test_report.rb | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/bio/appl/paml/codeml/report.rb b/lib/bio/appl/paml/codeml/report.rb index b46bb97f2..d16bab539 100644 --- a/lib/bio/appl/paml/codeml/report.rb +++ b/lib/bio/appl/paml/codeml/report.rb @@ -34,12 +34,13 @@ class Codeml # report.tree_lengh # => Estimated phylogetic tree length class Report - attr_reader :tree_log_likelihood, :tree_length, :alpha + attr_reader :tree_log_likelihood, :tree_length, :alpha, :tree def initialize(codeml_report) @tree_log_likelihood = pull_tree_log_likelihood(codeml_report) @tree_length = pull_tree_length(codeml_report) @alpha = pull_alpha(codeml_report) + @tree = pull_tree(codeml_report) end private @@ -57,6 +58,10 @@ def pull_alpha(text) text[/alpha .+ =\s+(-?\d+(\.\d+)?)/,1].to_f end + def pull_tree(text) + text[/([^\n]+)\n\nDetailed/m,1] + end + end # End Report end # End Codeml end # End Bio::PAML diff --git a/test/unit/bio/appl/paml/codeml/test_report.rb b/test/unit/bio/appl/paml/codeml/test_report.rb index b0a87302f..0b5f28ba4 100644 --- a/test/unit/bio/appl/paml/codeml/test_report.rb +++ b/test/unit/bio/appl/paml/codeml/test_report.rb @@ -34,4 +34,9 @@ def test_alpha assert_equal(0.58871, @example_report.alpha) end + def test_tree + tree = "(((rabbit: 0.082889, rat: 0.187866): 0.038008, human: 0.055050): 0.033639, goat-cow: 0.096992, marsupial: 0.284574);" + assert_equal(tree, @example_report.tree) + end + end From 3ff940988b76bdff75679cdf0af4c836f76fa3a1 Mon Sep 17 00:00:00 2001 From: Naohisa Goto Date: Wed, 3 Sep 2008 22:08:16 +0900 Subject: [PATCH 4/5] Bug fix: headers were parsed incorrectly with warning --- lib/bio/appl/blat/report.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/bio/appl/blat/report.rb b/lib/bio/appl/blat/report.rb index ca83d5aae..0ea72c3ec 100644 --- a/lib/bio/appl/blat/report.rb +++ b/lib/bio/appl/blat/report.rb @@ -1,10 +1,10 @@ # # = bio/appl/blat/report.rb - BLAT result parser # -# Copyright:: Copyright (C) 2004 GOTO Naohisa +# Copyright:: Copyright (C) 2004, 2006, 2008 Naohisa Goto # License:: The Ruby License # -# $Id: report.rb,v 1.13 2007/04/05 23:35:39 trevor Exp $ +# $Id:$ # # BLAT result parser (psl / pslx format). # @@ -86,10 +86,10 @@ def add_header_line(line) line = line.chomp case line when /^\d/ - @columns = defined? @header_lines ? parse_header(@header_lines) : [] + @columns = (defined? @header_lines) ? parse_header(@header_lines) : [] return false when /\A\-+\s*\z/ - @columns = defined? @header_lines ? parse_header(@header_lines) : [] + @columns = (defined? @header_lines) ? parse_header(@header_lines) : [] return self else @header_lines ||= [] From 1440b766202a2b66ac7386b9b46928834a9c9873 Mon Sep 17 00:00:00 2001 From: Naohisa Goto Date: Wed, 3 Sep 2008 22:11:34 +0900 Subject: [PATCH 5/5] Suppress warning messages To suppress warning messages "warning: private attribute?", private attributes are explicitly specified by using "private". --- lib/bio/io/flatfile/splitter.rb | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/bio/io/flatfile/splitter.rb b/lib/bio/io/flatfile/splitter.rb index f85ce8f6a..67c8552dd 100644 --- a/lib/bio/io/flatfile/splitter.rb +++ b/lib/bio/io/flatfile/splitter.rb @@ -1,7 +1,7 @@ # # = bio/io/flatfile/splitter.rb - input data splitter for FlatFile # -# Copyright (C) 2001-2006 Naohisa Goto +# Copyright (C) 2001-2008 Naohisa Goto # # License:: The Ruby License # @@ -76,30 +76,43 @@ def get_parsed_entry # (end position of the entry) + 1 attr_reader :entry_ended_pos - private + #-- + #private + # + ## to prevent warning message "warning: private attribute?", + ## private attributes are explicitly declared. + #++ + # entry data class attr_reader :dbclass + private :dbclass # input stream attr_reader :stream + private :stream # the last entry string read from the stream attr_writer :entry + private :entry= # the last entry as a parsed data object attr_writer :parsed_entry + private :parsed_entry= # start position of the entry attr_writer :entry_start_pos + private :entry_start_pos= # (end position of the entry) + 1 attr_writer :entry_ended_pos + private :entry_ended_pos= # Does stream.pos if entry_pos_flag is not nil. # Otherwise, returns nil. def stream_pos entry_pos_flag ? stream.pos : nil end + private :stream_pos end #class Template # Default splitter. @@ -264,10 +277,14 @@ def rewind ret end - private + #-- + #private methods / attributes + #++ # flag to fetch header attr_accessor :flag_to_fetch_header + private :flag_to_fetch_header + private :flag_to_fetch_header= end #class LineOriented