annotate config/config_init.rb @ 467:fd3078b4d355

Update to latest rails
author nanaya <me@nanaya.pro>
date Tue, 22 Oct 2019 16:17:30 +0900
parents a5eae5b07abf
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
437
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 147
diff changeset
1 $cfg = {}
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 147
diff changeset
2 $cfg[:secret_key] = ENV["ZP_SECRET_KEY"]
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 147
diff changeset
3 $cfg[:newrelic] = ENV["ZP_NEWRELIC"] == 1
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 147
diff changeset
4
438
a5eae5b07abf Prepare for removing custom database.yml
nanaya <me@myconan.net>
parents: 437
diff changeset
5 env = ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development"
a5eae5b07abf Prepare for removing custom database.yml
nanaya <me@myconan.net>
parents: 437
diff changeset
6 config_local = File.expand_path("config_local_#{env}.rb", __dir__)
437
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 147
diff changeset
7
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 147
diff changeset
8 require config_local if File.exist? config_local
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 147
diff changeset
9
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 147
diff changeset
10 $cfg[:standalone] = true if $cfg[:standalone].nil?
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 147
diff changeset
11 $cfg[:newrelic] = false if $cfg[:newrelic].nil?
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 147
diff changeset
12 $cfg[:log_to_stdout] = true if $cfg[:log_to_stdout].nil?
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 147
diff changeset
13
438
a5eae5b07abf Prepare for removing custom database.yml
nanaya <me@myconan.net>
parents: 437
diff changeset
14 $cfg[:bundler_groups] ||= [:default, env]
437
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 147
diff changeset
15 $cfg[:bundler_groups] << "standalone" if $cfg[:standalone]
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 147
diff changeset
16 $cfg[:bundler_groups] << "newrelic" if $cfg[:newrelic]
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 147
diff changeset
17
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 147
diff changeset
18 $cfg.freeze