File: envlist2.rb

package info (click to toggle)
html-template 0.16-2.1
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 128 kB
  • ctags: 111
  • sloc: ruby: 869; makefile: 41
file content (14 lines) | stat: -rwxr-xr-x 278 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/ruby

require "html/template"
tmpl = HTML::Template.new("envlist.html")
envlist = []
ENV.keys.sort.each do |k|
  envlist.push({
		 'key' => k,
		 'val' => ENV[k]
	       })
end
tmpl.param({'envlist' => envlist}) 
print "Content-Type: text/html\n\n"
print tmpl.output