ENV["I_LIKE_METHOD_ALIAS_CHAIN"] = "true" require 'rubygems' require 'haml' # performance optimizations. load 'paml.rb' require 'hoe' pml = Paml.new app = proc do |env| # run our enviornment up require 'active_support' if ENV["I_LIKE_METHOD_ALIAS_CHAIN"] == "true" filename = "/tmp/your_haml_here_#{rand(999999)}.haml" # Pre-process our template `php your_haml_here.haml.php > #{filename}` # render the template engine = Haml::Engine.new(open(filename).read) engine_rendered = engine.render # remove the template File.delete(filename) return [6969, { "Content-Type" => "text/html" }, pml.html_begin + engine_rendered + pml.title_img + pml.html_end] end run app