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')
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)
19 File
.open('fuzed.conf', 'w') do |f
|
23 puts
'successfully wrote fuzed.conf in current directory'