<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Capturing Output from PUTS in Ruby</title>
	<atom:link href="http://thinkingdigitally.com/archive/capturing-output-from-puts-in-ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://thinkingdigitally.com/archive/capturing-output-from-puts-in-ruby/</link>
	<description>programming for the fun of it</description>
	<lastBuildDate>Thu, 29 Mar 2012 16:19:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
	<item>
		<title>By: Jeremy Woertink</title>
		<link>http://thinkingdigitally.com/archive/capturing-output-from-puts-in-ruby/#comment-2662</link>
		<dc:creator>Jeremy Woertink</dc:creator>
		<pubDate>Wed, 03 Aug 2011 22:24:20 +0000</pubDate>
		<guid isPermaLink="false">http://thinkingdigitally.com/archive/capturing-output-from-puts-in-ruby/#comment-2662</guid>
		<description>&lt;p&gt;This is used in Thor.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
def capture(stream)
    begin
      stream = stream.to_s
      eval &quot;$#{stream} = StringIO.new&quot;
      yield
      result = eval(&quot;$#{stream}&quot;).string
    ensure
      eval(&quot;$#{stream} = #{stream.upcase}&quot;)
    end

    result
end
&lt;/pre&gt;

&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This is used in Thor.</p>

<pre><code>
def capture(stream)
    begin
      stream = stream.to_s
      eval "$#{stream} = StringIO.new"
      yield
      result = eval("$#{stream}").string
    ensure
      eval("$#{stream} = #{stream.upcase}")
    end

    result
end
</code></pre>

<p></p>]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart Corbishley</title>
		<link>http://thinkingdigitally.com/archive/capturing-output-from-puts-in-ruby/#comment-2661</link>
		<dc:creator>Stuart Corbishley</dc:creator>
		<pubDate>Tue, 26 Jul 2011 12:22:29 +0000</pubDate>
		<guid isPermaLink="false">http://thinkingdigitally.com/archive/capturing-output-from-puts-in-ruby/#comment-2661</guid>
		<description>&lt;p&gt;Thanks! This is insanely useful!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks! This is insanely useful!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://thinkingdigitally.com/archive/capturing-output-from-puts-in-ruby/#comment-2635</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Thu, 12 Aug 2010 20:53:58 +0000</pubDate>
		<guid isPermaLink="false">http://thinkingdigitally.com/archive/capturing-output-from-puts-in-ruby/#comment-2635</guid>
		<description>&lt;p&gt;Thank you!  Your elegant capture_stdout method was exactly what I needed for testing the &quot;trace&quot; feature of a little embedded interpreter I&#039;m working on.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thank you!  Your elegant capture_stdout method was exactly what I needed for testing the &#8220;trace&#8221; feature of a little embedded interpreter I&#8217;m working on.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Albert</title>
		<link>http://thinkingdigitally.com/archive/capturing-output-from-puts-in-ruby/#comment-2628</link>
		<dc:creator>Albert</dc:creator>
		<pubDate>Sun, 02 May 2010 18:33:30 +0000</pubDate>
		<guid isPermaLink="false">http://thinkingdigitally.com/archive/capturing-output-from-puts-in-ruby/#comment-2628</guid>
		<description>&lt;p&gt;Very helpful, thanks! I&#039;m testing a debug function that only &quot;puts&quot; when in a Rack application is in development mode.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Very helpful, thanks! I&#8217;m testing a debug function that only &#8220;puts&#8221; when in a Rack application is in development mode.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Derek Hammer</title>
		<link>http://thinkingdigitally.com/archive/capturing-output-from-puts-in-ruby/#comment-2623</link>
		<dc:creator>Derek Hammer</dc:creator>
		<pubDate>Tue, 02 Mar 2010 07:02:57 +0000</pubDate>
		<guid isPermaLink="false">http://thinkingdigitally.com/archive/capturing-output-from-puts-in-ruby/#comment-2623</guid>
		<description>&lt;p&gt;Thanks! This has really helped me out. I really hate saying things like &quot;I can&#039;t test this.&quot;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks! This has really helped me out. I really hate saying things like &#8220;I can&#8217;t test this.&#8221;</p>]]></content:encoded>
	</item>
</channel>
</rss>

