<?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: Reopening Ruby Classes</title>
	<atom:link href="http://juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/</link>
	<description>Break Coders Block!</description>
	<lastBuildDate>Thu, 10 May 2012 17:02:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: Josh Cheek</title>
		<link>http://juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/comment-page-1/#comment-14683</link>
		<dc:creator>Josh Cheek</dc:creator>
		<pubDate>Mon, 21 Jun 2010 16:19:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/#comment-14683</guid>
		<description>As of rails 2.x you would put it in an initializer. Make a ruby file in config/initializers and do your monkey patching in there.</description>
		<content:encoded><![CDATA[<p>As of rails 2.x you would put it in an initializer. Make a ruby file in config/initializers and do your monkey patching in there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Find tests more easily in your Rails test.log &#171; I like stuff</title>
		<link>http://juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/comment-page-1/#comment-297</link>
		<dc:creator>Find tests more easily in your Rails test.log &#171; I like stuff</dc:creator>
		<pubDate>Wed, 18 Jun 2008 02:38:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/#comment-297</guid>
		<description>[...] for your Rails project. To me this seems like a nice little example of how Ruby&#8217;s open classes can benefit developers (while understandably considered harmful by some). In a language without [...]</description>
		<content:encoded><![CDATA[<p>[...] for your Rails project. To me this seems like a nice little example of how Ruby&#8217;s open classes can benefit developers (while understandably considered harmful by some). In a language without [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learning Scala: Performance Impact of Implicit Conversions &#171; Villane</title>
		<link>http://juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/comment-page-1/#comment-296</link>
		<dc:creator>Learning Scala: Performance Impact of Implicit Conversions &#171; Villane</dc:creator>
		<pubDate>Sat, 02 Feb 2008 16:46:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/#comment-296</guid>
		<description>[...] languages have ways of doing similar things. JavaScript and Ruby actually let you add methods to existing objects, and these methods will then work everywhere else [...]</description>
		<content:encoded><![CDATA[<p>[...] languages have ways of doing similar things. JavaScript and Ruby actually let you add methods to existing objects, and these methods will then work everywhere else [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TechKnow</title>
		<link>http://juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/comment-page-1/#comment-295</link>
		<dc:creator>TechKnow</dc:creator>
		<pubDate>Mon, 16 Apr 2007 04:48:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/#comment-295</guid>
		<description>@Gene - If you want to reopen a Ruby class when Rails startups you might want to create a simple &lt;a href=&quot;http://www.juixe.com/techknow/index.php/2006/06/18/rails-plugin-tutorial/&quot; rel=&quot;nofollow&quot;&gt;Rails plugin&lt;/a&gt;.  If you go this route, just reopen the String class, or any class for that matter, in the init.rb file for the plugin.

Sometime back I mentioned that you can reopen a class in &lt;a href=&quot;http://www.juixe.com/techknow/index.php/2006/09/10/updating-a-rails-plugin/&quot; rel=&quot;nofollow&quot;&gt;Rails application helper&lt;/a&gt;.  I wrote that as a way to expend/update models provided by Rails plugins but it will also help you.</description>
		<content:encoded><![CDATA[<p>@Gene &#8211; If you want to reopen a Ruby class when Rails startups you might want to create a simple <a href="http://www.juixe.com/techknow/index.php/2006/06/18/rails-plugin-tutorial/" rel="nofollow">Rails plugin</a>.  If you go this route, just reopen the String class, or any class for that matter, in the init.rb file for the plugin.</p>
<p>Sometime back I mentioned that you can reopen a class in <a href="http://www.juixe.com/techknow/index.php/2006/09/10/updating-a-rails-plugin/" rel="nofollow">Rails application helper</a>.  I wrote that as a way to expend/update models provided by Rails plugins but it will also help you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gene</title>
		<link>http://juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/comment-page-1/#comment-294</link>
		<dc:creator>Gene</dc:creator>
		<pubDate>Sat, 14 Apr 2007 15:14:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/#comment-294</guid>
		<description>Thanks - I have a question related that I can&#039;t get answered to. In a Rails app, where do I do extensions of String like this? I want the String class to get extended as soon as rails starts up and have my additional string methods be available throughout the rails app.</description>
		<content:encoded><![CDATA[<p>Thanks &#8211; I have a question related that I can&#8217;t get answered to. In a Rails app, where do I do extensions of String like this? I want the String class to get extended as soon as rails starts up and have my additional string methods be available throughout the rails app.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim O'Brien</title>
		<link>http://juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/comment-page-1/#comment-293</link>
		<dc:creator>Tim O'Brien</dc:creator>
		<pubDate>Fri, 19 Jan 2007 22:25:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/#comment-293</guid>
		<description>Right on, I wrote a whole book about the Commons, but I do think that StringUtils is less of a great utility and more of a sign of huge problems.

The fact that you have to resort to big static method libraries and that we&#039;re still doing this in 2007 is an embarrassing failure.</description>
		<content:encoded><![CDATA[<p>Right on, I wrote a whole book about the Commons, but I do think that StringUtils is less of a great utility and more of a sign of huge problems.</p>
<p>The fact that you have to resort to big static method libraries and that we&#8217;re still doing this in 2007 is an embarrassing failure.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TechKnow</title>
		<link>http://juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/comment-page-1/#comment-292</link>
		<dc:creator>TechKnow</dc:creator>
		<pubDate>Thu, 18 Jan 2007 17:37:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/#comment-292</guid>
		<description>You would only use the class&#039; class_eval when you don&#039;t know the type before hand.  But if you know that you only want to add new code to a String, then it would be more intuitive to do as you suggest.</description>
		<content:encoded><![CDATA[<p>You would only use the class&#8217; class_eval when you don&#8217;t know the type before hand.  But if you know that you only want to add new code to a String, then it would be more intuitive to do as you suggest.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NoKarma</title>
		<link>http://juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/comment-page-1/#comment-291</link>
		<dc:creator>NoKarma</dc:creator>
		<pubDate>Thu, 18 Jan 2007 16:50:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.juixe.com/techknow/index.php/2007/01/17/reopening-ruby-classes-2/#comment-291</guid>
		<description>Woah! Are you sure that using SomeClass.class_eval do {some code} end is a good idea?

Why not simply using this:

class String
  [some_code]
end</description>
		<content:encoded><![CDATA[<p>Woah! Are you sure that using SomeClass.class_eval do {some code} end is a good idea?</p>
<p>Why not simply using this:</p>
<p>class String<br />
  [some_code]<br />
end</p>
]]></content:encoded>
	</item>
</channel>
</rss>

