def ok?
return false unless File.executable?("/usr/bin/luac")
output = []
config = self.generate_config(self.template)
tempfile = Tempfile.new(File.basename(self.filename))
tempfile.puts(config)
tempfile.close(false)
IO.popen( "/usr/bin/luac -p #{tempfile.path} 2>&1 ") {|io| output = io.readlines }
if $?.exitstatus == 0
tempfile.unlink
return true
else
warn output.collect{|o| "\t"+o}.join.chomp
File.rename(tempfile.path, tempfile.path+".conf")
warn "\tTemporary config snippet retained at #{tempfile.path}.conf"
return false
end
true
end