Sha256: 7a4932b4349d03ddae20c6dba458ba96414bfac10015a02746bc0c436ea0b712
Contents?: true
Size: 642 Bytes
Versions: 12
Compression:
Stored size: 642 Bytes
Contents
# frozen_string_literal: true module Recog class DBManager require 'nokogiri' require 'recog/db' attr_accessor :path, :databases DefaultDatabasePath = File.expand_path(File.join(File.expand_path(__dir__), ['..', '..', 'recog', 'xml'])) def initialize(path = DefaultDatabasePath) self.path = path reload end def load_databases if File.directory?(path) Dir["#{path}/*.xml"].each do |dbxml| databases << DB.new(dbxml) end else databases << DB.new(path) end end def reload self.databases = [] load_databases end end end
Version data entries
12 entries across 12 versions & 1 rubygems