Sha256: 8f470cd94de47f21426db147564155d69a5c6263ede7051ff0300781d75e79a0

Contents?: true

Size: 580 Bytes

Versions: 73

Compression:

Stored size: 580 Bytes

Contents

module Recog
class DBManager
  require 'nokogiri'
  require 'recog/db'

  attr_accessor :path, :databases

  DefaultDatabasePath = File.expand_path( File.join( File.dirname(__FILE__), "..", "..", "xml") )

  def initialize(path = DefaultDatabasePath)
    self.path = path
    reload
  end

  def load_databases
    if File.directory?(self.path)
      Dir[self.path + "/*.xml"].each do |dbxml|
        self.databases << DB.new(dbxml)
      end
    else
      self.databases << DB.new(self.path)
    end
  end

  def reload
    self.databases = []
    load_databases
  end

end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
recog-2.3.23 lib/recog/db_manager.rb
recog-2.3.22 lib/recog/db_manager.rb
recog-2.3.21 lib/recog/db_manager.rb
recog-2.3.20 lib/recog/db_manager.rb
recog-2.3.19 lib/recog/db_manager.rb
recog-2.3.18 lib/recog/db_manager.rb
recog-2.3.17 lib/recog/db_manager.rb
recog-2.3.16 lib/recog/db_manager.rb
recog-2.3.15 lib/recog/db_manager.rb
recog-2.3.14 lib/recog/db_manager.rb
recog-2.3.13 lib/recog/db_manager.rb
recog-2.3.12 lib/recog/db_manager.rb
recog-2.3.11 lib/recog/db_manager.rb
recog-2.3.10 lib/recog/db_manager.rb
recog-2.3.9 lib/recog/db_manager.rb
recog-2.3.8 lib/recog/db_manager.rb
recog-2.3.7 lib/recog/db_manager.rb
recog-2.3.6 lib/recog/db_manager.rb
recog-2.3.5 lib/recog/db_manager.rb
recog-2.3.4 lib/recog/db_manager.rb