Created
August 22, 2011 11:09
-
-
Save miaout17/1162151 to your computer and use it in GitHub Desktop.
simple yaml+erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
production: | |
name: <%= name %> | |
password: <%= password %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
require 'erb' | |
def go | |
name = 'hihihi' | |
password = 'mypassword' | |
yml = ERB.new(File.read('config.yaml.erb')).result(binding) | |
puts YAML.load(yml).inspect | |
end | |
go() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment