Last active
December 14, 2015 14:48
-
-
Save stuartf/5102896 to your computer and use it in GitHub Desktop.
Render 3akai-ux nginx.conf using ruby
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'erb' | |
require 'ostruct' | |
require 'json' | |
namespace = OpenStruct.new | |
namespace.nginxConf = OpenStruct.new(JSON.parse(IO.read('nginx.json'))) | |
template = IO.read('nginx.conf') | |
puts ERB.new(template).result(namespace.instance_eval { binding }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment