Module: Alvid
- Defined in:
- lib/alvid.rb,
lib/alvid/keypair.rb,
lib/alvid/version.rb
Defined Under Namespace
Classes: Github, Keypair, Retro
Constant Summary collapse
- VERSION =
"0.2.5"
Class Method Summary collapse
Class Method Details
.init ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/alvid.rb', line 5 def self.init puts ENV.inspect db_uri = if ENV['VCAP_SERVICES'].nil? || JSON.parse(ENV['VCAP_SERVICES']).empty? require 'dm-sqlite-adapter' 'sqlite::memory:' else require 'dm-mysql-adapter' product_name, service = JSON.parse(ENV['VCAP_SERVICES']).first puts "Product name: #{product_name}" puts "Service: #{product_name}" case product_name when /mysql|cleardb/ service.first['credentials']['uri'] end end DataMapper.setup(:default, db_uri) end |