Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
def do_export v1, v2 pre_regexp = build_regexp(v1.body) replace_string = build_string(v2.body) File.open('somefile') do |f| replace = f.read.gsub(pre_regexp, replace_string) f.rewind f.puts(replace) end end
This paste will be private.
From the Design Piracy series on my blog: