31: def htmlfile(type, graphs, field)
32: file = File.join(hostdir, "%s.html" % type)
33: File.open(file, "w") do |of|
34: of.puts "<html><head><title>%s graphs for %s</title></head><body>" %
35: [type.capitalize, host]
36:
37: graphs.each do |graph|
38: if field == :first
39: name = graph.sub(/-\w+.png/, '').capitalize
40: else
41: name = graph.sub(/\w+-/, '').sub(".png", '').capitalize
42: end
43: of.puts "<img src=%s><br>" % graph
44: end
45: of.puts "</body></html>"
46: end
47:
48: return file
49: end