Skip to content

Commit

Permalink
Fixes #20969 - Allow setting the rails version via settings.yaml.dist
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl authored and dLobatog committed Sep 20, 2017
1 parent 8762baa commit c96801e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/boot_settings.rb
Expand Up @@ -5,6 +5,7 @@
SETTINGS = File.exist?(dist_settings_file) ? YAML.load(ERB.new(File.read(dist_settings_file)).result) || {} : {}

settings_file = File.expand_path('../settings.yaml', __FILE__)
SETTINGS[:rails] = YAML.load(ERB.new(File.read(settings_file)).result)[:rails]
settings = YAML.load(ERB.new(File.read(settings_file)).result)
SETTINGS[:rails] = settings[:rails] if settings[:rails]
SETTINGS[:rails] ||= RUBY_VERSION < '2.3' ? '4.2' : '5.0'
SETTINGS[:rails] = '%.1f' % SETTINGS[:rails] if SETTINGS[:rails].is_a?(Float) # unquoted YAML value

0 comments on commit c96801e

Please sign in to comment.