新手问题 [ruby] 如何生成带&描点的 yaml 文件

MistShi · February 19, 2013 · Last by diga2005 replied at April 20, 2013 · 2148 hits

如何通过 ruby 生成类似如下格式,带& 和 <<:* 的 yaml 文件:

# config/application.yml
defaults: &defaults
  cool:
    saweet: nested settings
  neat_setting: 24
  awesome_setting: <%= "Did you know 5 + 5 = #{5 + 5}?" %>

development:
  <<: *defaults
  neat_setting: 800

test:
  <<: *defaults

production:
  <<: *defaults
You need to Sign in before reply, if you don't have an account, please Sign up first.