![]() |
HowTo.DeployRubyUsingLighttpd HistoryHide minor edits - Show changes to markup June 21, 2008, at 04:34 PM
by --
Changed lines 71-72 from:
</body> </html> to:
Contents of directory: June 21, 2008, at 04:33 PM
by --
Deleted lines 28-29:
\\ rescue Exception\\ Added lines 30-31:
rescue Exception June 21, 2008, at 04:18 PM
by --
Deleted lines 30-31:
Added lines 32-33:
print "Content-Type: text/html\n\n" Changed lines 49-51 from:
to:
June 21, 2008, at 04:17 PM
by --
Changed lines 48-49 from:
to:
Added lines 57-58:
Deleted line 60:
Added lines 63-74:
</html>
You can now write your web app in Ruby using Erb templates! June 21, 2008, at 04:13 PM
by --
Added lines 49-61:
June 21, 2008, at 04:08 PM
by --
Changed lines 5-55 from:
@@
require 'time' require 'erb' time = Time.now.httpdate HEADERS = <<EOF Date: #{ time } Server: #{ ENV['SERVER_SOFTWARE'] } Last-Modified: #{ time } Content-Type: text/html EOF begin
erb = File.open(ENV["SCRIPT_FILENAME"]) { |f| ERB.new(f.read) }
print HEADERS + erb.result(binding)
rescue Exception print "Content-Type: text/html\n\n"
# error message
print "<h1>Script Error</h1>"
print "<pre>#{ $! }</pre>"
# debug info
print "<h2>Backtrace</h2>"
print "<pre>#{$!.backtrace.join("\n")}</pre>"
print "<h2>Environment</h2>"
print "<pre>#{ENV.keys.map { |key| key + ' = ' + ENV[key] + "\n"} }</pre>"
print "<hr>"
print "<i>#{__FILE__} -- #{time}</i>"
end @@ to:
June 21, 2008, at 04:05 PM
by --
Added lines 1-55:
@@
require 'time' require 'erb' time = Time.now.httpdate HEADERS = <<EOF Date: #{ time } Server: #{ ENV['SERVER_SOFTWARE'] } Last-Modified: #{ time } Content-Type: text/html EOF begin
erb = File.open(ENV["SCRIPT_FILENAME"]) { |f| ERB.new(f.read) }
print HEADERS + erb.result(binding)
rescue Exception print "Content-Type: text/html\n\n"
# error message
print "<h1>Script Error</h1>"
print "<pre>#{ $! }</pre>"
# debug info
print "<h2>Backtrace</h2>"
print "<pre>#{$!.backtrace.join("\n")}</pre>"
print "<h2>Environment</h2>"
print "<pre>#{ENV.keys.map { |key| key + ' = ' + ENV[key] + "\n"} }</pre>"
print "<hr>"
print "<i>#{__FILE__} -- #{time}</i>"
end @@ |