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.1.32 lib/recog/db_manager.rb
recog-2.1.31 lib/recog/db_manager.rb
recog-2.1.30 lib/recog/db_manager.rb
recog-2.1.29 lib/recog/db_manager.rb
recog-2.1.28 lib/recog/db_manager.rb
recog-2.1.27 lib/recog/db_manager.rb
recog-2.1.26 lib/recog/db_manager.rb
recog-2.1.25 lib/recog/db_manager.rb
recog-2.1.24 lib/recog/db_manager.rb
recog-2.1.23 lib/recog/db_manager.rb
recog-2.1.22 lib/recog/db_manager.rb
recog-2.1.21 lib/recog/db_manager.rb
recog-2.1.20 lib/recog/db_manager.rb
recog-2.1.19 lib/recog/db_manager.rb
recog-2.1.18 lib/recog/db_manager.rb
recog-2.1.17 lib/recog/db_manager.rb
recog-2.1.16 lib/recog/db_manager.rb
recog-2.1.15 lib/recog/db_manager.rb
recog-2.1.14 lib/recog/db_manager.rb
recog-2.1.13 lib/recog/db_manager.rb