Skip to content

Instantly share code, notes, and snippets.

require 'sinatra'
require 'pp'
require 'redis'
require 'json'
configure do
redis = JSON.parse(ENV['VMC_SERVICES']).select {|srvc| srvc['name'] =~ /redis-.*?/ }.first['options']
redis_conf = {:host => redis['hostname'], :port => redis['port'], :password => redis['password']}
@@redis = Redis.new redis_conf