yaws 1.73 compatibility
[fuzed.git] / bin / fuzed-conf
blob7cf0e2b358aab588b1491d5a12dfde7c81ebac7c
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 puts conf