<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Capture standard output in Ruby</title>
	<link>http://stefankst.net/2007/06/05/capture-standard-output-in-ruby/</link>
	<description>Weblog</description>
	<pubDate>Tue, 06 Jan 2009 22:59:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: Lancer Kind</title>
		<link>http://stefankst.net/2007/06/05/capture-standard-output-in-ruby/#comment-382</link>
		<dc:creator>Lancer Kind</dc:creator>
		<pubDate>Tue, 19 Feb 2008 19:57:06 +0000</pubDate>
		<guid>http://stefankst.net/2007/06/05/capture-standard-output-in-ruby/#comment-382</guid>
		<description>Great article!  This outlines a solution that goes a long way into solving unit testing of stdout that is a problem with Java/C#.  It's also great that based on the need you've set up for code reuse, you introduced blocks/yield.  

The problem around StringIO not working is interesting.  I agree with your conclusion about the code not using duck typing.  Duck typing is something new that a lot of us are going to need to work at to get used to.  Checking the type of the superclass in order to make decisions about its capabilities feels like the developer was still stuck in the strong type checking paradigm in Java/C#.  When Java was the new cool OO kid on the block in 1995, one saw a lot of Java code that was written as if it was C (poor encapsulation, lots of public fields, few/really-long methods, checking return codes instead of using exception handling).  I expect a lot of Ruby code is going to look like Java/C# code but implemented in Ruby for a while until people unlearn some habits.  (I know I'm working to do that.)  

Bravo!  Reading this has been a great use of my time!</description>
		<content:encoded><![CDATA[<p>Great article!  This outlines a solution that goes a long way into solving unit testing of stdout that is a problem with Java/C#.  It&#8217;s also great that based on the need you&#8217;ve set up for code reuse, you introduced blocks/yield.  </p>
<p>The problem around StringIO not working is interesting.  I agree with your conclusion about the code not using duck typing.  Duck typing is something new that a lot of us are going to need to work at to get used to.  Checking the type of the superclass in order to make decisions about its capabilities feels like the developer was still stuck in the strong type checking paradigm in Java/C#.  When Java was the new cool OO kid on the block in 1995, one saw a lot of Java code that was written as if it was C (poor encapsulation, lots of public fields, few/really-long methods, checking return codes instead of using exception handling).  I expect a lot of Ruby code is going to look like Java/C# code but implemented in Ruby for a while until people unlearn some habits.  (I know I&#8217;m working to do that.)  </p>
<p>Bravo!  Reading this has been a great use of my time!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://stefankst.net/2007/06/05/capture-standard-output-in-ruby/#comment-9</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Fri, 21 Sep 2007 18:24:44 +0000</pubDate>
		<guid>http://stefankst.net/2007/06/05/capture-standard-output-in-ruby/#comment-9</guid>
		<description>This rocks.  I wrote a couple of scripts to check on mysql replication. The scripts write to a log file and stardard out, but I want to send a daily report on the replication, and this should make it easy to capture the output from the script and stick it in an email. Thanks</description>
		<content:encoded><![CDATA[<p>This rocks.  I wrote a couple of scripts to check on mysql replication. The scripts write to a log file and stardard out, but I want to send a daily report on the replication, and this should make it easy to capture the output from the script and stick it in an email. Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
