require 'rom' require 'rom/lotus/version' ROM.use :auto_registration module ROM module Lotus class << self attr_reader :config end class Config attr_reader :root attr_reader :repositories def initialize(root) @root = root @repositories = {} end def db_dir root.join('db') end end def self.setup(app) app.synchronize do @config = Config.new(app.configuration.root.join('../..').realpath) yield(@config) ROM.setup(config.repositories) %w(relations mappers commands).each do |component| Dir["#{config.root}/lib/*/#{component}/**/*.rb"].each do |file| require file end end ROM.finalize end end end end