Sha256: 47ba157324eba78a6f1c07475d631bda784e485b815a4a657fd4b88693733335

Contents?: true

Size: 451 Bytes

Versions: 1

Compression:

Stored size: 451 Bytes

Contents

require 'data_mapper'
require 'json'

module Alvid
  def self.init
    db_uri = if ENV['VCAP_SERVICES'].nil? || JSON.parse(ENV['VCAP_SERVICES']).empty?
                require 'dm-sqlite-adapter'
               'sqlite::memory:'
             else
               JSON.parse(ENV['VCAP_SERVICES']).first[1].first.first[1]['uri']
             end
    DataMapper.setup(:default, db_uri)
  end
end

Alvid.init

require "alvid/version"
require "alvid/retro"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alvid-0.1.0 lib/alvid.rb