fix bignum decoding in erlectricity
[fuzed.git] / bin / fuzed-conf
blob9e221b2cf007540b33e8c4e6d2a2d7400c188298
1 #!/usr/bin/env ruby
3 puts("You must specify the absolute path to your Rails root as the first argument") and exit unless ARGV[0]
5 rails_public_dir = File.join(ARGV[0], 'public')
7 SUBSTITUTIONS =
8 {:rails_public_dir => rails_public_dir,
9 :port => ARGV[1] || "80"}
11 template = File.join(File.dirname(__FILE__), *%w[.. templates fuzed.conf])
13 conf = File.open(template).read
14 SUBSTITUTIONS.each_pair do |key, data|
15 repl_key = '{{ ' + key.to_s.upcase + ' }}'
16 conf.gsub!(repl_key, data)
17 end
19 File.open('fuzed.conf', 'w') do |f|
20 f.write conf
21 end
23 puts 'successfully wrote fuzed.conf in current directory'