Skip to content

Commit

Permalink
Bug fix: Bio::Fasta::Report should be autoloaded
Browse files Browse the repository at this point in the history
 * Bug fix: Bio::Fasta::Report should be autoloaded.
 * Removed useless method Bio::Fasta::Report.parser because
   only the "format10" parser is available for a long time
   and dynamic require is a potential security hole.
 * Removed "require" lines in Bio::Fasta#parse_result.
  • Loading branch information
ngoto committed May 2, 2009
1 parent e573495 commit 3d3edc4
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions lib/bio/appl/fasta.rb
Expand Up @@ -16,7 +16,7 @@ module Bio

class Fasta

#autoload :Report, 'bio/appl/fasta/format10'
autoload :Report, 'bio/appl/fasta/format10'
#autoload :?????, 'bio/appl/fasta/format6'

# Returns a FASTA factory object (Bio::Fasta).
Expand Down Expand Up @@ -66,16 +66,6 @@ def format=(num)
end
attr_reader :format

# Select parser to use ('format6' and 'format10' is acceptable for now)
#
# This method will import Bio::Fasta::Report class by requiring specified
# parser and will be useful when you already have fasta output files and
# want to use appropriate Report class for parsing.
#
def self.parser(parser)
require "bio/appl/fasta/#{parser}"
end

# Returns a FASTA factory object (Bio::Fasta) to run FASTA search on
# local computer.
def self.local(program, db, option = '')
Expand All @@ -102,12 +92,6 @@ def query(query)


def parse_result(data)
case @format
when 6
require 'bio/appl/fasta/format6'
when 10
require 'bio/appl/fasta/format10'
end
Report.new(data)
end

Expand Down

0 comments on commit 3d3edc4

Please sign in to comment.