<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>gnuu.org &#187; ruby</title>
	<atom:link href="http://gnuu.org/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://gnuu.org</link>
	<description>my word against yours, fight.</description>
	<lastBuildDate>Fri, 16 Jul 2010 22:12:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>YARD Object Oriented Diffing</title>
		<link>http://gnuu.org/2010/06/26/yard-object-oriented-diffing/</link>
		<comments>http://gnuu.org/2010/06/26/yard-object-oriented-diffing/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 23:19:52 +0000</pubDate>
		<dc:creator>Loren Segal</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[object oriented]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[yard]]></category>

		<guid isPermaLink="false">http://gnuu.org/2010/06/26/yard-object-oriented-diffing/</guid>
		<description><![CDATA[Yesterday I tweeted a bunch about a new command in the upcoming YARD 0.6 release called yard diff which lets you perform object-aware diffs across two versions of a project/library/gem. I wanted to summarize exactly what&#8217;s going on and why I wrote it in a short article on the subject.]]></description>
			<content:encoded><![CDATA[<p>Yesterday I tweeted a bunch about a new command in the upcoming YARD 0.6 release called <code>yard diff</code> which lets you perform object-aware diffs across two versions of a project/library/gem. I wanted to summarize exactly what&#8217;s going on and why I wrote it in a short article on the subject.</p>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://gnuu.org/2010/06/26/yard-object-oriented-diffing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preview of YARD 0.6 Features</title>
		<link>http://gnuu.org/2010/06/16/preview-of-yard-0-6-features/</link>
		<comments>http://gnuu.org/2010/06/16/preview-of-yard-0-6-features/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 19:37:44 +0000</pubDate>
		<dc:creator>Loren Segal</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[0.6]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[yard]]></category>

		<guid isPermaLink="false">http://gnuu.org/2010/06/16/preview-of-yard-0-6-features/</guid>
		<description><![CDATA[YARD 0.5.7 is currently in the works and is possibly a week or so from release. After that version is put out there (pending no serious issues), all &#34;yardwork&#34; will be exclusively dedicated to the 0.6 release. There are some really cool and exciting new features in 0.6, so I felt like blogging about them. [...]]]></description>
			<content:encoded><![CDATA[<p>YARD 0.5.7 is currently in the works and is possibly a week or so from release. After that version is put out there (pending no serious issues), all &quot;yardwork&quot; will be exclusively dedicated to the 0.6 release. There are some really cool and exciting new features in 0.6, so I felt like blogging about them. Let&#8217;s go:</p>
<h2>1. A Local Documentation Server</h2>
<p> <img title="yardoc.org/docs screenshot" alt="yardoc.org/docs screenshot" align="right" src="http://yardoc.org/images/yardocorg.png" width="332" height="233" />
<p>RubyGems has <tt>gem server</tt> to serve static docs of your gems. The problem here, again, is that to get these static .html files we need to force our users to generate docs when the gem installs, and this is often a painfully slow process (especially with behemoths like Rails). YARD takes a different approach to this, only parsing out the source and saving an intermediate dump file when a gem installs. This is pretty fast (~2 seconds under 1.9 for YARD&#8217;s codebase). Not only can a developer use this data to their heart&#8217;s content, but it allows YARD to generate HTML/PDF/LaTeX on demand, and that&#8217;s exactly what 0.6 is going to do.</p>
<p>The <tt>yard server</tt> command coming in 0.6 will generate HTML documentation for gems on demand from the parsed source (perhaps even parsing on demand). This means your CPU will never be used to generate static files that you never look at. If you only need to access 10% of the documentation of 1% of your gems, YARD will only generate that 0.1%. Big win.</p>
<p>Not to mention you get all the benefits a YARD template provides, including full class hierarchy, less obtrusive layouts, markdown support, and even full method/class name searching with the potential of having full-text searching in the future, since this is all running in a Webrick/Rack adapter.</p>
<p>All of this stuff is currently being ported from the existing <a href="http://yardoc.org/docs">yardoc.org/docs</a> site, so it will basically look like that. The existing code is in the <a href="http://github.com/lsegal/yard/tree/docserver">docserver</a> branch of YARD&#8217;s github and is being tracked as <a href="http://github.com/lsegal/yard/issues/issue/139">gh-139</a>.</p>
<h2>2. Method Listing by Groups</h2>
<p> <img title="Mac OSX documentation for NSString" border="0" alt="Mac OSX documentation for NSString" align="right" src="http://gnuu.org/wp-content/uploads/2010/06/image_thumb.png" width="264" height="183" />
<p>We&#8217;ve seen this in Apple&#8217;s docs, doxygen docs and a few others. The ability to organize methods in a large class by functionality rather than alphabet is often far more helpful to your users. YARD 0.6 will be introducing a <tt>@group</tt> freeform tag to identify methods under a specific organizational header which will be used in the templates. Still working on the exact syntax of this one, trying to make it as easy to use and remove as much duplication as possible. This feature is being tracked as <a href="http://github.com/lsegal/yard/issues/issue/143">gh-143</a>.</p>
<h2>3. Generate Documentation for Single File Scripts</h2>
<p>RDoc has a <tt>--one-file</tt> option that is occasionally used for small Ruby scripts. YARD has always lacked this option. Though it&#8217;s kind of simple to roll your own with templates, 0.6 will have built-in templates for generating a single HTML document. Not really sure what it&#8217;s going to look like just yet, but if you have ideas or want to help out, the feature is being tracked as <a href="http://github.com/lsegal/yard/issues/issue/115">gh-115</a>.</p>
<h2>4. New <tt>yard</tt> CLI executable</h2>
<p>YARD is growing into a tool that does much more than just parse source. This means that having a single executable is not enough, and spreading out the functionality over multiple executables is just messy. YARD currently uses the <tt>yard-graph</tt> tool to generate Graphviz dot files. In YARD 0.6, all of these tools, including the new documentation server, will all be merged into a single executable called <tt>yard</tt> with respective subcommands (doc, graph, server, etc.). The goal here is to open this up for plugins to add commands just like they do in RubyGems without resorting to new executable names. And don&#8217;t worry, the <tt>yardoc</tt> executable will probably stick around for legacy support. This feature is being tracked as <a href="http://github.com/lsegal/yard/issues/issue/140">gh-140</a>.</p>
<h2>5. Improved Template APIs</h2>
<p>If you&#8217;ve ever written or overridden a template in YARD you know that it can be hard to figure out what section to override with the <tt>sections</tt> command. YARD has a <tt>sections.place(:foo).before(:bar)</tt> idiom, but it does not help with subsections. In 0.6, the sections will be redesigned from being Array objects to a more proper tree-like structure in order to handle accessing subsections. Now instead of:</p>
<pre><code>def init
  sections.first.last.place(:foo).before(:bar)
end</code></pre>
<p>You will have the ability to do the following:</p>
<pre><code>def init
  sections.first.subsections.place(:foo).before(:bar)
  # or even:
  sections.place(:foo).before_first(:bar)
end</pre>
<p></code></p>
<p>The last method will look for any "bar" inside sections or subsections within the tree. All in all, this should make it more effective to override a template. This feature is being tracked as <a href="http://github.com/lsegal/yard/issues/issue/58">gh-58</a>.</p>
<h2>6. Documentation for DSL Handlers and Other Use Cases</h2>
<p>YARD packs in a lot of functionality, and many users have complained that they had to dig into source to find out how to do some relatively simple things like writing handlers for DSL syntaxes. Although YARD does have documentation on many things, including writing handlers in general, there are few "use-case specific" documents that describe how to do specific things with YARD. 0.6 will introduce improved documentation for some of these use cases, most importantly extending YARD for custom DSL syntaxes. It's possible this may start as a project in the Github Wiki as a set of how-to guides.</p>
<p>So there they are, the major new features coming to 0.6. Let me know if you have any suggestions about other features. And if you have time to donate to the project that would be great, see the above Github issue links and help out. Money would also be appreciated; I wrote YARD because I want to improve docs in the community, not because I want money, but I need to eat. You can donate below:</p>
<p><a href="http://www.pledgie.com/campaigns/940"><img alt="Click here to lend your support to: yard and make a donation at www.pledgie.com !" src="http://www.pledgie.com/campaigns/940.png?skin_name=chrome" border="0" /></a></p>
<p>The release plan for YARD 0.6 is: "soon". It's hard to say when it will be out, but things are certainly rolling in that direction.</p>]]></content:encoded>
			<wfw:commentRss>http://gnuu.org/2010/06/16/preview-of-yard-0-6-features/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing &#8220;Friend&#8221;: Adding Fine Grained Visibility Semantics to Ruby</title>
		<link>http://gnuu.org/2010/04/01/announcing-friend-adding-fine-grained-visibility-semantics-to-ruby/</link>
		<comments>http://gnuu.org/2010/04/01/announcing-friend-adding-fine-grained-visibility-semantics-to-ruby/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 21:12:07 +0000</pubDate>
		<dc:creator>Loren Segal</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[eiffel]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[Metaprogramming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[visibility]]></category>

		<guid isPermaLink="false">http://gnuu.org/2010/04/01/announcing-friend-adding-fine-grained-visibility-semantics-to-ruby/</guid>
		<description><![CDATA[Note: this is not an April Fool&#8217;s joke. And no, this notice is not an April Fool&#8217;s joke either. Update: 04/02/2010 &#8211; Thanks to Martin Luder who pointed out that you can in fact do visibility in Eiffel without the inheritance &#8220;export&#8221; syntax. Updated the example. I&#8217;ve used Eiffel a couple of times. I&#8217;ve even [...]]]></description>
			<content:encoded><![CDATA[<p class="note"><strong>Note</strong>: this is not an April Fool&#8217;s joke. And no, this notice is not an April Fool&#8217;s joke either.</p>
<p class="note"><strong>Update: 04/02/2010</strong> &#8211; Thanks to Martin Luder who pointed out that you can in fact do visibility in Eiffel without the inheritance &#8220;export&#8221; syntax. Updated the example.</p>
<p>I&#8217;ve used <a href="http://www.eiffel.com/">Eiffel</a> a couple of times. I&#8217;ve even <a href="http://gnuu.org/2008/09/19/a-basic-http-req-in-eiffel-and-rant/">blogged about it</a> once. There&#8217;s one really cool feature in Eiffel that lives below the whole DbC radar. Peculiarly, the feature itself deals with &quot;features&quot;. Basically, Eiffel allows you to decide which classes can see which &quot;features&quot; (in Ruby features are basically methods) on an individual basis. Therefore, Eiffel has no need for a half-baked &quot;public&quot;, &quot;protected&quot;, &quot;private&quot; solution to the visibility problem because by exporting features you have extreme control over exactly how public, protected or private a feature can be. Here&#8217;s what it looks like:</p>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://gnuu.org/2010/04/01/announcing-friend-adding-fine-grained-visibility-semantics-to-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Let&#8217;s Do Some Engineering Pt. 1: Design Patterns</title>
		<link>http://gnuu.org/2010/03/26/lets-do-some-engineering-pt-1-design-patterns/</link>
		<comments>http://gnuu.org/2010/03/26/lets-do-some-engineering-pt-1-design-patterns/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 00:33:34 +0000</pubDate>
		<dc:creator>Loren Segal</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[engineering]]></category>
		<category><![CDATA[patterns]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://gnuu.org/?p=392</guid>
		<description><![CDATA[View part 2 of this series: Software Metrics. We Rubyists like to call ourselves engineers. For the most part, there are a lot of great engineering practices being applied in the realm of testing. Continuous integration, acceptance testing and other automated testing are some pretty advanced techniques that are not so well-practiced in other communities. [...]]]></description>
			<content:encoded><![CDATA[<p class="note">View part 2 of this series: <a href="http://gnuu.org/2010/04/06/software-metrics/">Software Metrics</a>.</p>
<p>We Rubyists like to call ourselves engineers. For the most part, there are a lot of great engineering practices being applied in the realm of testing. <a href="http://en.wikipedia.org/wiki/Continuous_integration">Continuous integration</a>, <a href="http://en.wikipedia.org/wiki/Acceptance_testing">acceptance testing</a> and other automated testing are some pretty advanced techniques that are not so well-practiced in other communities. We should all be proud of ourselves in this respect. </p>
<p>But you can&#8217;t just do testing right and call yourself an all-around engineer. There are still plenty of engineering concepts that Rubyists ignore or completely reject but can prove pretty useful for a well structured project. Techniques like the use of design patterns, metrics, traceability and estimation are all important but seem to be completely ignored by most Rubyists I know. I’m going to cover these all in parts over the next few weeks starting with design patterns, because it’s the easiest to cover. </p>
<p>Note that I can&#8217;t teach you patterns. You probably know most of them anyway. If not, please visit <a href="http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29">Wikipedia</a> or buy <a href="http://www.amazon.ca/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612">Design Patterns</a>. I just want to point out that you should pay more attention to them. And here&#8217;s why:</p>
<p><!-- more --></p>
<h2>Denial is a River</h2>
<p>The issue here is that although many Rubyists <em>make use of</em> design patterns every day, some of them (who shall remain unnamed) refuse to accept that they are actually making use of patterns, citing that the names of these patterns imply a complexity that is not actually being expressed. The &quot;complexity&quot; here usually comes from the fact that these patterns are mostly applied in static languages (like Java) where design patterns are occasionally more difficult to implement due to all the extra moving parts, compilation and explicit typing. None of this makes these patterns any less effective or any more restricted to Java (or C++, or &#8230;). Patterns are still patterns whether you acknowledge them or not, and they are not defined by the LOC or number of classes they require in language X. I mean, come on, Rails used to have &quot;MVC&quot; and &quot;ActiveRecord&quot; plastered on the website to sell its new web development technique, two patterns ripped right out of <a href="http://www.amazon.com/exec/obidos/ASIN/0321127420">P of EAA</a>. Now MVC is a household name. Rails is the ultimate testament that a pattern can be simple to implement in a simple language. Refusing to admit that patterns are used hurts your development team and the community, because patterns (simply identifying them) serve a very important purpose.</p>
<h2>Why Patterns Matter</h2>
<p><a href="http://www.patmaddox.com/">Pat Maddox</a> brought this up at his <a href="http://mtnwestrubyconf.org/2010">MWRC2010</a> talk a few weeks ago. I forget his exact wording, but the paraphrasing goes a little something like: &quot;patterns convey meaning&quot;. This is entirely true. I think it was Pat who also brought up the idea of <a href="http://en.wikibooks.org/wiki/Software_Engineering_with_an_Agile_Development_Framework/Iteration_One/System_metaphor#Software_development:_system_metaphor">metaphors in Agile development</a> at a MWRC lunch. Metaphors in Agile are the idea that the team decides on a metaphor that expresses some high level concept of the project, and they use this metaphor exclusively to convey this concept. This saves time because usually these metaphors are one or two words. It also keeps everyone on the same page, because they all know (or can look up) what the metaphor really means. The differences between two metaphors can be subtle but have large impact on the functionality of a system. For example, consider the metaphors &quot;email&quot; and &quot;instant messaging&quot;. Although emails can be short and instant and instant messages can be long and very email-like, we already know (mostly from experience) that the functionality of these two systems involve some significantly different user interactions. If your client wanted &quot;email&quot; and got &quot;instant messaging&quot;, they would notice the difference and probably complain.</p>
<p>Well, design patterns are just like these metaphors, but they are meant for code, not UI. Just like metaphors, they convey a very specific meaning in one or two words. This means they save everyone time. They can also be looked up, because there is a pretty good set of standard design patterns (<a href="http://www.amazon.ca/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612">GoF</a>, <a href="http://www.amazon.com/exec/obidos/ASIN/0321127420">Fowler</a>) that people can look up and immediately understand. These patterns can have very subtle differences depending on the terminology used. For instance, consider the <a href="http://en.wikipedia.org/wiki/Factory_method_pattern">factory pattern</a> versus the <a href="http://en.wikipedia.org/wiki/Builder_pattern">builder pattern</a>. Both are concerned with creating objects, but a builder is also concerned with the assembling of the object. This is a relatively subtle but pretty noticeable difference. Telling someone you are using a &quot;builder pattern&quot; should immediately ring a bell in their heads saying, &quot;oh, it&#8217;s not <em>just</em> a factory&quot;. </p>
<p>These patterns also come with another interesting benefit: <em>authority</em>. We know these patterns work, because they&#8217;ve been running in production code for decades. There is no argument about whether the factory pattern works, because it does. We know this. When someone proposes a design and tells you &quot;I&#8217;m going to use X because it&#8217;s worked in hundreds of previous projects that have had this same problem,&quot; that&#8217;s <em>real engineering</em>. </p>
<h3>A Tiny Case Study</h3>
<p>But back to the topic of saving time: just the other week <a href="http://jamesgolick.com/">James Golick</a> blogged about <a href="http://jamesgolick.com/2010/3/14/crazy-heretical-and-awesome-the-way-i-write-rails-apps.html">how he writes Rails apps</a>. Now, James is a really smart guy, and he&#8217;s way ahead of the curve when it comes to good engineering. But really, his whole blog post could have been replaced with the statement: &quot;Here&#8217;s how I do Rails apps: I don&#8217;t create domain objects directly in my controller. Instead I create all of my domain objects through the <em><a href="http://en.wikipedia.org/wiki/Command_pattern">Command pattern</a></em>. &lt;example here&gt;&quot; End of blog post. </p>
<p>Now of course this is an exaggeration, there&#8217;s some explanation of how this relates to his tests, coupling and logging. But a lot of this discussion and assertion that it&#8217;s smart is also unnecessary when we describe the design through the command pattern. We <em>know</em> what a command pattern does, what problems it solves, and why it is used. We know that it&#8217;s meant to solve coupling issues, help implement <a href="http://en.wikipedia.org/wiki/Single_responsibility_principle">SRP</a> properly and comes with the implicit benefit of <a href="http://en.wikipedia.org/wiki/Composability">composability</a> and <a href="http://en.wikipedia.org/wiki/Dependency_injection">dependency injection</a>. More importantly, we know there&#8217;s nothing heretical about his methods at all; he&#8217;s using an authoritative design used by many others in this situation. No justification necessary, James.</p>
<h2>Some to Get You Started</h2>
<p>Now I know I said I wouldn&#8217;t teach you patterns, but here are a few you should definitely look into if you&#8217;re developing any kind of client-server architecture these days:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Adapter_pattern">Adapter</a></li>
<li><a href="http://en.wikipedia.org/wiki/Command_pattern">Command</a></li>
<li><a href="http://en.wikipedia.org/wiki/Decorator_pattern">Decorator</a></li>
<li><a href="http://en.wikipedia.org/wiki/Facade_pattern">Facade</a></li>
<li><a href="http://en.wikipedia.org/wiki/Factory_method_pattern">Factory</a></li>
<li><a href="http://en.wikipedia.org/wiki/Strategy_pattern">Strategy</a></li>
<li><a href="http://martinfowler.com/eaaCatalog/unitOfWork.html">Unit of Work</a></li>
</ul>
<p>If you&#8217;ve never heard of any of these, look them up now. I use most of these <em>daily</em>, and you should be using them as well (you probably already are). Being aware of their existence can help you rethink some of your designs and find ways to make them much simpler by applying design patterns that have worked many times before. More importantly, when you review your current architecture (as any good engineer periodically does), having the ability to associate your design with existing, working, <em>authoritative</em> patterns should certainly give you some confidence in your system.</p>]]></content:encoded>
			<wfw:commentRss>http://gnuu.org/2010/03/26/lets-do-some-engineering-pt-1-design-patterns/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fixing Ruby&#8217;s Inheritance Model with Metamorph</title>
		<link>http://gnuu.org/2010/03/25/fixing-rubys-inheritance-model/</link>
		<comments>http://gnuu.org/2010/03/25/fixing-rubys-inheritance-model/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 20:20:53 +0000</pubDate>
		<dc:creator>Loren Segal</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[alias_method_chain]]></category>
		<category><![CDATA[Metaprogramming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://gnuu.org/?p=388</guid>
		<description><![CDATA[Warning: I&#8217;m not really advising anybody to use this hack in production code, but it is an interesting bit of code that may have a few good use cases. Last night I thought of a really neat trick to solve this long-running “to alias_method_chain or not to alias_method_chain” feud. It’s completely transparent, meaning it requires [...]]]></description>
			<content:encoded><![CDATA[<p class="note"><strong>Warning:</strong> I&#8217;m not really advising anybody to use this hack in production code, but it is an interesting bit of code that may have a few good use cases.</p>
<p>Last night I thought of a really neat trick to solve this long-running “<em>to <a href="http://weblog.rubyonrails.org/2006/4/26/new-in-rails-module-alias_method_chain">alias_method_chain</a> or <a href="http://yehudakatz.com/2009/03/06/alias_method_chain-in-models/">not</a> to <a href="http://yehudakatz.com/2010/02/15/abstractqueryfactoryfactories-and-alias_method_chain-the-ruby-way/">alias_method_chain</a></em>” feud. It’s completely transparent, meaning it requires absolutely <em>no modification</em> to your original code. More importantly, it essentially changes Ruby’s inheritance model to what I would consider the “correct” model, with respect to mixin behaviour.</p>
<p> <!-- more --><br />
<h2>A Little Background</h2>
<p>The issue that people bump their heads against can be expressed by the following Ruby example. Say I&#8217;m using a library that defines some class &#8216;A&#8217;:</p>
<pre class="sh_ruby">class A
  def foo; &quot;foo&quot; end
end</pre>
<p>Being the Rubyist that I am, I want to be able to extend this method and add my own behaviour, but without wiping out the original. This is where <tt>alias_method_chain</tt> <em>traditionally</em> comes in. I would normally just rename the method and call it myself from my overridden method. The problems with that have been discussed ad infinitum, and people have realized that mixing in a module is proper OO, much cleaner, maintains inheritance, etc.. so let&#8217;s do that:</p>
<pre class="sh_ruby">module B; def foo; super + &quot;bar&quot; end end
class A; include B end</pre>
<p><strong>Problem!</strong> You probably noticed this. &quot;But &#8216;foo&#8217; is defined directly in A,&quot; you say, &quot;you can&#8217;t override it with a mixin!&quot;</p>
<p>This is the ultimate problem with Ruby&#8217;s inheritance model, in my opinion. Because mixins always take lower priority than methods defined directly in a class body, <tt>A#foo</tt> can not be overridden by mixin inclusion. Moreover, because mixins take lower priority than methods, <tt>A#foo</tt> is now violating encapsulation, but to see this we will need to modify our example slightly.</p>
<h2>What is Proper Encapsulation, Anyway?</h2>
<p>Encapsulation is the idea that only a component knows about its internal structure. But structure in OOP implies your inheritance tree as much as it implies your data. Suppose our &#8216;A&#8217; class inherited some class &#8216;X&#8217; and the <tt>A#foo</tt> method we&#8217;ve been calling really calls the super method <tt>X#foo</tt>:</p>
<pre class="sh_ruby">class X
  def foo; &quot;foo&quot; end
end
class A &lt; X; def foo; super end end</pre>
<p>When our class &#8216;A&#8217; calls super, it expects that super should be class &#8216;X&#8217;, because this is its internal structure as defined by A. By this standard, mixing in another module should not change A&#8217;s internal expectations. Mixing in a module <em>should</em> create the following encapsulation, where B encapsulates A:</p>
<p><img alt="Correct Encapsulation" src="http://gnuu.org/wp-content/uploads/2010/03/correct_encapsulation.png" width="300" height="300" /></p>
<p>This is what mixing in a module after A has been created should look like. However, Ruby does not wrap our &#8216;A&#8217; class, instead it injects itself <em>under</em> A:</p>
<p><img alt="Incorrect Encapsulation" src="http://gnuu.org/wp-content/uploads/2010/03/incorrect_encapsulation.png" width="300" height="300" /></p>
<p>Here we have modified the &quot;internal structure&quot; of A, violating proper encapsulation. Whether or not this is &quot;right&quot; or &quot;wrong&quot; depends on how you view the concept of re-opening a class in Ruby. However, pragmatically speaking, this behaviour causes a lot of problems with the way people tend to write code in Ruby-land (and, in general, many languages). Firstly, it requires that developers design for the possibility that a module would be inserted <em>into</em> itself rather than wrapped around, which means to properly accept mixins you should always call &quot;super&quot; in all of your methods since you never know what your inheritance tree will look like. Secondly, it requires you to opt-in to allowing a method to be overridden by a mixin by performing very explicit code transformations that make your code harder to document and add needless complexity. I&#8217;m referring to the <tt>ClassMethods</tt> and <tt>InstanceMethods</tt> module idioms that Rails likes to use. These are problematic because <a href="http://yardoc.org">most documentation tools</a> will show these methods as being &quot;inherited&quot; by the class (if at all), and although this is technically correct, these methods now need to be addressed and looked up as <tt>ClassName::InstanceMethods#method_name</tt> which is unintuitive for the user. Of course this is in addition to actually organizing your code in this manner, which is, in general, an unintuitive step. These are all <em>workarounds</em> to deal with the failings of a proper inheritance model.</p>
<h2>Solving Encapsulation Transparently</h2>
<p>So how can we solve the inheritance/encapsulation problem and do so with as small a footprint as possible? This is what I came up with last night:</p>
<pre class="sh_ruby">class Object
  def self.method_added(name)
    return if name == :initialize
    const_set(:InstanceMethods, Module.new) unless defined?(self::InstanceMethods)
    meth = instance_method(name)
    self::InstanceMethods.send(:define_method, name) {|*args, &amp;block| meth.bind(self).call(*args, &amp;block) }
    remove_method(name)
    include self::InstanceMethods
  end
end</pre>
<p>This simple hook transparently defines all new methods inside an anonymous inner module, essentially doing this source transformation for us on the fly. As mentioned, it requires no modification to the source code you&#8217;re trying to modify, simply add this code before including the rest. For instance, with the above hook, we can now do the following with our original example:</p>
<pre class="sh_ruby">class A; def foo; &quot;foo&quot; end end
module B; def foo; super + &quot;bar&quot; end end

A.new.foo # =&gt; &quot;foo&quot;
A.send(:include, B)
A.new.foo # =&gt; &quot;foobar&quot;</pre>
<p>Note that we need not change the code from our original example and our mixed in module now takes precedence over the explicitly defined <tt>A#foo</tt>.</p>
<h3>Hold on There, Cowboy</h3>
<p><em>&quot;But that looks so inefficient!&quot;</em> you scream. For those who noticed, you will see that we&#8217;ve been replacing every method with a delegate Proc object that performs quite a lot of <em>crap</em> before dispatching another method call. <strong>Yes, it&#8217;s inefficient</strong>. There is, however, a better way to do this, but it involves native code. I&#8217;ve implemented the native version for 1.9.x, but I&#8217;ll spare you the details and code. If you care, you can check the github link (see below). </p>
<h2>The Metamorph Gem (1.9 Only)</h2>
<p>In 1.9 you can do a <tt>gem install metamorph</tt> to get this gem. It&#8217;s a native gem, so it requires a compile. For 1.8 (or Windows machines) you can use the above non-native version, but it will probably be slower.</p>
<p>The code is on github at: <a href="http://github.com/lsegal/metamorph">http://github.com/lsegal/metamorph</a>, so if you want to make it work in 1.8, feel free.</p>
<p>PS. It’s not that it’s impossible to implement (efficiently) in 1.8, it’s simply that I don’t personally care about your legacy Rubies the same way DHH never cared about your legacy DBs. Oddly enough, people seem to love their legacy Rubies and still manage to hate legacy databases, but that’s a rant for another day.</p>]]></content:encoded>
			<wfw:commentRss>http://gnuu.org/2010/03/25/fixing-rubys-inheritance-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visualizing Class Relationships with YARD and InfoVis</title>
		<link>http://gnuu.org/2009/12/18/visualizing-class-relationships/</link>
		<comments>http://gnuu.org/2009/12/18/visualizing-class-relationships/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 05:30:36 +0000</pubDate>
		<dc:creator>Loren Segal</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[class diagram]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[visualization]]></category>
		<category><![CDATA[yard]]></category>

		<guid isPermaLink="false">http://gnuu.org/?p=361</guid>
		<description><![CDATA[Note: This post requires an HTML5 capable browser. FF3.5+, Safari, Chrome (or any WebKit browser) will do the trick. That should cover most of my readers. I love visualization toolkits, so when I found out about the JS visualization toolkit InfoVis, I had to play with it. Generally the first thing that comes to mind [...]]]></description>
			<content:encoded><![CDATA[<p class="note"><strong>Note:</strong> This post requires an HTML5 capable browser. FF3.5+, Safari, Chrome (or any WebKit browser) will do the trick. That should cover most of my readers.</p>
<p>I love visualization toolkits, so when I found out about the JS visualization toolkit <a href="http://thejit.org">InfoVis</a>, I had to play with it. Generally the first thing that comes to mind when visualizing data is class model relationships, so I figured I’d write another snippet to export data from <a href="http://yardoc.org">YARD</a> into a JS-friendly format and see how it looked. This time, I’ll spare the show-and-tell and just do the showing, since the code to export this data is fairly trivial.</p>
<p>I basically used the few examples from the site but plugged in class relationship data from Ruby libraries to get the following visualization of YARD in particular:</p>
<h2>Visualization 1: Simple Tree View</h2>
<p><iframe src="/yardviz/viz1.html" width="605" height="605" frameborder="0"></iframe></p>
<p>Pretty simple, we can also make it look a little fancier:</p>
<h2>Visualization 2: Polar Tree View</h2>
<p><iframe src="/yardviz/viz2.html" width="605" height="605" frameborder="0"></iframe></p>
<h2>Visualization 3: Coupling</h2>
<p>It then occurred to me that visualizations like these (weighted graphs in particular) would be a good way to visualize class coupling in your library. I experimented with the concept by generating a weighted graph, but it seems InfoVis&#8217; RGraph class (which they demo a weighted graph with) isn&#8217;t really that great at really visualizing the weights, also it doesn&#8217;t seem to support weighted graphs. The end result shows some interesting data, but it&#8217;s not exactly great to really view coupling.</p>
<p class="note"><strong>Note:</strong> FF doesn&#8217;t seem to like this one. Don&#8217;t be surprised if it doesn&#8217;t work.</p>
<p><iframe src="/yardviz/viz3.html" width="605" height="605" frameborder="0"></iframe></p>
<p>Those are the visualizations I played with. There&#8217;s a <a href="/yardviz">nicer version here</a> that lets you see visualizations for Ruby&#8217;s core lib and Rails in addition to YARD&#8217;s, plus it has some extra niceties like showing methods in the current highlighted class on the side (not enough space to show it on my blog). Check it out.</p>
<p>Thanks to <strong>Josh Martin</strong> for pointing out InfoVis today, by the way.</p>]]></content:encoded>
			<wfw:commentRss>http://gnuu.org/2009/12/18/visualizing-class-relationships/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing The Longest YARD: 0.5.0</title>
		<link>http://gnuu.org/2009/12/14/announcing-the-longest-yard-0-5-0/</link>
		<comments>http://gnuu.org/2009/12/14/announcing-the-longest-yard-0-5-0/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 01:17:12 +0000</pubDate>
		<dc:creator>Loren Segal</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[0.5.0]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby 1.9]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[yard]]></category>

		<guid isPermaLink="false">http://gnuu.org/2009/12/14/announcing-the-longest-yard-0-5-0/</guid>
		<description><![CDATA[YARD 0.5.0 (“The Longest”) was just released today. It features a bunch of new things, but some of the most awesome are: Support for documenting native Ruby C code Incremental file parsing and HTML generation Improved yri tool with support for linking gems Support for Documenting Native Ruby C Code This one was certainly a [...]]]></description>
			<content:encoded><![CDATA[<p>YARD 0.5.0 (<em>“The Longest”</em>) was just released today. It features a bunch of new things, but some of the most awesome are:</p>
<ol>
<li>Support for documenting native Ruby C code </li>
<li>Incremental file parsing and HTML generation </li>
<li>Improved yri tool with support for linking gems </li>
</ol>
<h2>Support for Documenting Native Ruby C Code</h2>
<p>This one was certainly a long time coming. YARD has always planned to support native Ruby code. This was probably the last &quot;big&quot; feature that RDoc could do and YARD could not. Now, YARD can.</p>
<p>The best part of this feature is that YARD can now parse Ruby&#8217;s core codebase and the stdlib, meaning <a href="http://yardoc.org">yardoc.org</a> can now host Ruby-core docs. And it now does: <a href="http://yardoc.org/docs/ruby-core">http://yardoc.org/docs/ruby-core</a>. The stdlib will be added soon.</p>
<h2>Incremental file parsing and HTML generation</h2>
<p>One annoying thing about documenting code with YARD for larger projects is the time it takes to generate HTML. This makes the documentation development cycle slow for previewing small documentation changes. YARD 0.5.0 introduces incremental parsing and HTML generation to parse and generate HTML for only the files that were modified since the last running of <tt>yardoc</tt>, which makes for super-fast previews. To use the incremental parsing feature, simply add <tt>-c</tt> or <tt>--use-cache</tt> and YARD will use the available .yardoc cache.</p>
<pre>$ yardoc --use-cache</pre>
<h2>Improved yri tool with support for linking gems</h2>
<p>The <tt>yri</tt> tool that bundled with YARD prior to this release only worked for the .yardoc file in the local directory. In YARD 0.5.0, <tt>yri</tt> will now perform a lookup on all installed gems on your system. To use this, you&#8217;ll first need to build the .yardoc files for your gems, and you can do this with <tt>yardoc --build-gems</tt>. After that, you can use yri as normal:</p>
<pre>$ yri JSON#load</pre>
<h2>More?</h2>
<p>You can see more new toys in the <a href="http://yardoc.org/docs/yard/file:WhatsNew.md">What’s New</a> document on <a href="http://yardoc.org">yardoc.org</a>. You can also install YARD:</p>
<pre>$ gem install yard</pre>
<p>Enjoy!</p>]]></content:encoded>
			<wfw:commentRss>http://gnuu.org/2009/12/14/announcing-the-longest-yard-0-5-0/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>YARD 0.4.0 (The Whole Nine) Released Today</title>
		<link>http://gnuu.org/2009/11/15/yard-0-4-0-the-whole-nine/</link>
		<comments>http://gnuu.org/2009/11/15/yard-0-4-0-the-whole-nine/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 18:04:33 +0000</pubDate>
		<dc:creator>Loren Segal</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[developer tools]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby 1.9]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[yard]]></category>

		<guid isPermaLink="false">http://gnuu.org/?p=317</guid>
		<description><![CDATA[YARD 0.4.0 (codenamed The Whole Nine) was just released today. It’s by far the biggest release since I started writing YARD in 2007. For those who don’t know, YARD is a Ruby documentation tool that surpasses the features of RDoc to bring much richer docs and extensibility to documenteurs. There’s plenty of new features to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://yardoc.org">YARD 0.4.0</a> (codenamed The Whole Nine) was just released today. It’s by far the biggest release since I started writing YARD in 2007. For those who don’t know, YARD is a Ruby documentation tool that surpasses the features of RDoc to bring much richer docs and extensibility to documenteurs. There’s plenty of new features to discuss and plenty of new toys to show off (new templates, live doc server with user comments, new APIs, plugin support), so let’s get started.</p>
<p> </p>]]></content:encoded>
			<wfw:commentRss>http://gnuu.org/2009/11/15/yard-0-4-0-the-whole-nine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Ruby 1.9, Rails, MySQL and UTF-8 to Work Together</title>
		<link>http://gnuu.org/2009/11/06/ruby19-rails-mysql-utf8/</link>
		<comments>http://gnuu.org/2009/11/06/ruby19-rails-mysql-utf8/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 02:01:33 +0000</pubDate>
		<dc:creator>Loren Segal</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby 1.9]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[utf-8]]></category>

		<guid isPermaLink="false">http://gnuu.org/2009/11/06/get-ruby-1-9-rails-mysql-and-utf-8-to-work-together/</guid>
		<description><![CDATA[Update: You can also try out my fork of mysql-ruby that is properly encoding aware. It doesn&#8217;t just convert everything to UTF-8, but rather to your default encoding, so make sure to set your LANG! Here&#8217;s a quick little hack to get MySQL 2.8.1 using UTF-8 in Rails 2.3.4 and Ruby 1.9.1. Filename: lib/mysql_utf8.rb Put [...]]]></description>
			<content:encoded><![CDATA[<p class="note"><strong>Update:</strong> You can also try out my <a href="http://github.com/lsegal/mysql-ruby">fork of mysql-ruby</a> that is properly encoding aware. It doesn&#8217;t just convert everything to UTF-8, but rather to your default encoding, so make sure to <a href="http://gnuu.org/2009/11/02/ruby-1-9-encoding-issues-again/">set your LANG</a>!</p>
<p>Here&#8217;s a quick little hack to get MySQL 2.8.1 using UTF-8 in Rails 2.3.4 and Ruby 1.9.1.</p>
<p class="note">Filename: lib/mysql_utf8.rb</p>
<p><script src="http://gist.github.com/228455.js"></script></p>
<p><!--
<pre class="sh_ruby">class Mysql::Result
  def encode(value, encoding = &#8220;utf-8&#8243;)
    String === value ? value.force_encoding(encoding) : value
  end

  def each_utf8(&#038;block)
    each_orig do |row|
      yield row.map {|col| encode(col) }
    end
  end
  alias each_orig each
  alias each each_utf8

  def each_hash_utf8(&#038;block)
    each_hash_orig do |row|
      row.each {|k, v| row[k] = encode(v) }
      yield(row)
    end
  end
  alias each_hash_orig each_hash
  alias each_hash each_hash_utf8
end</pre>
<p>--></p>
<p>Put that snippet in your Rails project (I used <tt>lib/mysql_utf8.rb</tt>) and load it in your environment.</p>
<p>That's all. Now your queries should use Unicode:</p>
<pre class="sh_ruby">$ ./script/console
Loading development environment (Rails 2.3.4)
&gt;&gt; u = User.find(1)
=&gt; #&lt;User id: 1, name: &quot;Test&quot;, ...&gt;
&gt;&gt; u.name.encoding
=&gt; #&lt;Encoding:ASCII-8BIT&gt;
&gt;&gt; require 'lib/mysql_utf8'
=&gt; []
&gt;&gt; u = User.find(1)
=&gt; #&lt;User id: 1, name: &quot;Test&quot;, ...&gt;
&gt;&gt; u.name.encoding
=&gt; #&lt;Encoding:UTF-8&gt;</pre>
<p>Note that if you have BLOB types in MySQL you’ll need to force_encoding back to another type. You could do this in your model.</p>]]></content:encoded>
			<wfw:commentRss>http://gnuu.org/2009/11/06/ruby19-rails-mysql-utf8/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Barracuda: An OpenCL Library for Ruby</title>
		<link>http://gnuu.org/2009/08/30/barracuda-an-opencl-library-for-ruby/</link>
		<comments>http://gnuu.org/2009/08/30/barracuda-an-opencl-library-for-ruby/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 00:18:39 +0000</pubDate>
		<dc:creator>Loren Segal</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[barracuda]]></category>
		<category><![CDATA[cuda]]></category>
		<category><![CDATA[gpgpu]]></category>
		<category><![CDATA[gpu]]></category>
		<category><![CDATA[opencl]]></category>
		<category><![CDATA[parallel computing]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://gnuu.org/2009/08/30/barracuda-an-opencl-library-for-ruby/</guid>
		<description><![CDATA[Barracuda is my latest experiment. I wanted to toy around with the new features of Snow Leopard, and as far as I’ve seen, there are no CUDA or OpenCL wrapper libraries out there for Ruby. OpenCL, if you don’t know, is an “open” version of CUDA, which is NVIDIA’s proprietary architecture for GPGPU programming. Okay, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://gnuu.org/wp-content/uploads/2009/08/D846PlymouthBarracudaCatchaCudaPosters.jpg" rel="lightbox"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="D846~Plymouth-Barracuda-Catch-a-Cuda-Posters" border="0" alt="D846~Plymouth-Barracuda-Catch-a-Cuda-Posters" align="right" src="http://gnuu.org/wp-content/uploads/2009/08/D846PlymouthBarracudaCatchaCudaPosters_thumb.jpg" width="260" height="206" /></a>
<p><a href="http://github.com/lsegal/barracuda">Barracuda</a> is my latest experiment. I wanted to toy around with the new features of Snow Leopard, and <a href="http://www.ruby-forum.com/topic/165155">as far as I’ve seen</a>, there are no CUDA or OpenCL wrapper libraries out there for Ruby.</p>
<p><a href="http://www.khronos.org/opencl/">OpenCL</a>, if you don’t know, is an “<a href="http://en.wikipedia.org/wiki/Open_standards">open</a>” version of <a href="http://en.wikipedia.org/wiki/CUDA">CUDA</a>, which is NVIDIA’s proprietary architecture for <a href="http://en.wikipedia.org/wiki/GPGPU">GPGPU</a> programming. Okay, acronyms out of the way, this means that OpenCL is a way to run small but heavy computations in parallel on your GPU’s hundred or so cores. There’s a great demo of why this is cool at <a href="http://www.macresearch.org/opencl_episode1">MacResearch</a> (skip to the end of the video).</p>
<p>I should point out that while the library is called Barra<em>cuda</em> (did you get it?), there&#8217;s currently no CUDA support. I want to add support for CUDA down the road after I figure out what&#8217;s involved, though.</p>
<h3>Show and Tell Time</h3>
<p>Anyway, long story short, I wrote a <em>very basic</em> wrapper for OpenCL which currently only supports signed integers and floats, but will hopefully add some more functionality soon. I know you’re all dying for a demo, so, here’s a benchmark of some integer to float related computation in Ruby, versus the same computation using Barracuda:</p>
<pre class="sh_ruby">require 'barracuda'
require 'benchmark'

include Barracuda

prog = Program.new &lt;&lt;-eof
  __kernel sum(__global float *out, __global int *in, int total) {
    int i = get_global_id(0);
    if (i &lt; total) out[i] = ((float)in[i] + 0.5) / 3.8 + 2.0;
  }
eof

arr = (1..3333333).to_a
input = Buffer.new(arr)
output = OutputBuffer.new(:float, arr.size)

Benchmark.bmbm do |x|
  x.report(&quot;cpu&quot;) { arr.map {|x| (x.to_f + 0.5) / 3.8 + 2.0 } }
  x.report(&quot;gpu&quot;) { prog.sum(output, input, arr.size) }
end</pre>
<p>The way OpenCL works is you compile a C-like program on the GPU, then run it on the GPU with your data input and get some output; it’s a standard <a href="http://en.wikipedia.org/wiki/Pipeline_%28software%29">Pipes and Filters</a> architecture. The compilation of the program happens through LLVM, meaning it doesn’t require GCC, so this is not like running <a href="http://www.zenspider.com/ZSS/Products/RubyInline/">RubyInline</a>. Also we’re running these programs on like 200 cores, so there’s that part too. Anyway, “<em>where are the benchmark results?”</em> you must be yelling right now, so here:</p>
<pre>Rehearsal ---------------------------------------
cpu   5.510000   0.250000   5.760000 (  5.767632)
gpu   0.630000   0.260000   0.890000 (  0.930966)
------------------------------ total: 6.650000sec

          user     system      total        real
cpu   3.860000   0.020000   3.880000 (  3.931644)
gpu   0.310000   0.040000   0.350000 (  0.366625)</pre>
<p>Okay, it’s only about a <big><strong>10x</strong></big> speed increase. That’s not <em>too</em> impressive. Keep in mind though, <tt>(x + 0.5) / 3.8 + 2.0</tt> is a freaking <em>simple</em> computation. I dare someone to hook this up to some Hadoop map-reduce and see some real world results, because they’d probably be much more impressive.</p>
<h3>Wanna Try It?</h3>
<p><strong>The catch</strong>: you can install Barracuda if you&#8217;re on OSX 10.6 (Snow Leopard) or have a way to get OpenCL on your machine and hack up the Makefiles. I&#8217;d like to add support for other environments but I <em>just</em> finished this build.</p>
<p>If you have the right stuff you can grab it right from rubyforge:</p>
<pre>sudo gem install barracuda</pre>
<p>Or visit the git repo:</p>
<pre><a href="http://github.com/lsegal/barracuda">http://github.com/lsegal/barracuda</a></pre>]]></content:encoded>
			<wfw:commentRss>http://gnuu.org/2009/08/30/barracuda-an-opencl-library-for-ruby/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
