Sha256: 193c7a8cf81b3c748de0a118437e0052a7b610fc4340d0c792c567a7b1ea0ad0

Contents?: true

Size: 481 Bytes

Versions: 54

Compression:

Stored size: 481 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
    Dir[self.path + "/*.xml"].each do |dbxml|
      self.databases << DB.new(dbxml)
    end
  end

  def reload
    self.databases = []
    load_databases
  end

end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
recog-2.0.24 lib/recog/db_manager.rb
recog-2.0.23 lib/recog/db_manager.rb
recog-2.0.22 lib/recog/db_manager.rb
recog-2.0.21 lib/recog/db_manager.rb
recog-2.0.20 lib/recog/db_manager.rb
recog-2.0.19 lib/recog/db_manager.rb
recog-2.0.18 lib/recog/db_manager.rb
recog-2.0.17 lib/recog/db_manager.rb
recog-2.0.16 lib/recog/db_manager.rb
recog-2.0.15 lib/recog/db_manager.rb
recog-2.0.14 lib/recog/db_manager.rb
recog-2.0.13 lib/recog/db_manager.rb
recog-2.0.12 lib/recog/db_manager.rb
recog-2.0.11 lib/recog/db_manager.rb
recog-2.0.10 lib/recog/db_manager.rb
recog-2.0.9 lib/recog/db_manager.rb
recog-2.0.8 lib/recog/db_manager.rb
recog-2.0.7 lib/recog/db_manager.rb
recog-2.0.6 lib/recog/db_manager.rb
recog-2.0.5 lib/recog/db_manager.rb