Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
require 'rubygems' require 'mongrel' require_gem "activerecord" ActiveRecord::Base.establish_connection(:adapter => "mysql", :host => "localhost", :database => "foo", :username => "root") class Baz < ActiveRecord::Base end class BazHandler < Mongrel::HttpHandler def process(request, response) params_str = request.params[Mongrel::Const::PATH_INFO] a, b, c, d = params_str.split("/") response.start(200) do |head,out| Baz.create(:a => a, :b => b, :c => c).save end end end h = Mongrel::HttpServer.new("0.0.0.0", "5000") h.register("/baz", BazHandler.new) h.run.join
This paste will be private.
From the Design Piracy series on my blog: