require 'groonga' require File.expand_path(File.dirname(__FILE__)) + '/groovy/model' module Groovy VERSION = '0.1.0'.freeze def self.init(db_path, opts = {}) if File.exist?(db_path) puts "Opening DB" Groonga::Database.open(db_path) else dir = File.dirname(db_path) puts "Creating DB in #{dir}" FileUtils.mkdir_p(dir) Groonga::Database.create(path: db_path) end end end