Sha256: fbbaef43863b63fede426382a99a90898cf90d664b359728173170f171c2ebf9

Contents?: true

Size: 767 Bytes

Versions: 1

Compression:

Stored size: 767 Bytes

Contents

require 'rom'
require 'rom/lotus/version'

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rom-lotus-0.0.1 lib/rom-lotus.rb