From: Ryan Leavengood Date: 2005-12-08T12:03:46+09:00 Subject: Re: How to capture PrettyPrint output to string? require 'pp' require 'stringio' def my_pp(*args) old_out = $stdout begin s=StringIO.new $stdout=s pp(*args) ensure $stdout=old_out end s.string end