view config/config_init.rb @ 76:0c023d35cd80

Allows usage of multiple twitter keys Working around api rate limit
author nanaya <me@myconan.net>
date Sun, 26 Jun 2016 16:46:02 +0900
parents e9a6019a34ea
children f76d44baa3dc
line wrap: on
line source

$cfg = {
  :twitter0 => {
    :consumer_key => ENV["RT_CONSUMER_KEY"],
    :consumer_secret => ENV["RT_CONSUMER_SECRET"],
    :access_token => ENV["RT_ACCESS_TOKEN"],
    :access_token_secret => ENV["RT_ACCESS_TOKEN_SECRET"]
  },
  :memcached_servers => ENV["RT_MEMCACHED_SERVERS"].try(:split, ",")
}

config_local = File.expand_path("../config_local_#{Rails.env}.rb", __FILE__)

require config_local if File.exist? config_local

$cfg.freeze