comparison config/config_init.rb @ 438:a5eae5b07abf

Prepare for removing custom database.yml
author nanaya <me@myconan.net>
date Sat, 02 Jul 2016 17:18:07 +0900
parents d31fe32da7a0
children
comparison
equal deleted inserted replaced
437:d31fe32da7a0 438:a5eae5b07abf
1 $cfg = {} 1 $cfg = {}
2 $cfg[:secret_key] = ENV["ZP_SECRET_KEY"] 2 $cfg[:secret_key] = ENV["ZP_SECRET_KEY"]
3 $cfg[:newrelic] = ENV["ZP_NEWRELIC"] == 1 3 $cfg[:newrelic] = ENV["ZP_NEWRELIC"] == 1
4 4
5 config_local = File.expand_path("config_local_#{Rails.env}.rb", __dir__) 5 env = ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development"
6 config_local = File.expand_path("config_local_#{env}.rb", __dir__)
6 7
7 require config_local if File.exist? config_local 8 require config_local if File.exist? config_local
8 9
9 $cfg[:standalone] = true if $cfg[:standalone].nil? 10 $cfg[:standalone] = true if $cfg[:standalone].nil?
10 $cfg[:newrelic] = false if $cfg[:newrelic].nil? 11 $cfg[:newrelic] = false if $cfg[:newrelic].nil?
11 $cfg[:log_to_stdout] = true if $cfg[:log_to_stdout].nil? 12 $cfg[:log_to_stdout] = true if $cfg[:log_to_stdout].nil?
12 13
13 $cfg[:bundler_groups] ||= [:default, Rails.env] 14 $cfg[:bundler_groups] ||= [:default, env]
14 $cfg[:bundler_groups] << "standalone" if $cfg[:standalone] 15 $cfg[:bundler_groups] << "standalone" if $cfg[:standalone]
15 $cfg[:bundler_groups] << "newrelic" if $cfg[:newrelic] 16 $cfg[:bundler_groups] << "newrelic" if $cfg[:newrelic]
16 17
17 $cfg.freeze 18 $cfg.freeze