Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
require 'rubygems' require 'hpricot' xml = "<item><title foo='bar'></title></item><item><title foo='hum'></title></item><item><title foo='bug'></title></item>" doc = Hpricot.XML(xml) (doc/:item).each do |item| puts item.at(:title).attributes['foo'] end $ ruby hp.rb bar hum bug
This paste will be private.
From the Design Piracy series on my blog: