<?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>Ruby</title> <atom:link href="http://seriouslyruby.com/feed/" rel="self" type="application/rss+xml" /><link>http://seriouslyruby.com</link> <description>real-time discovery by s.erious.ly</description> <lastBuildDate>Thu, 09 Sep 2010 11:41:53 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <atom:link rel='hub' href='http://seriouslyruby.com/?pushpress=hub'/> <cloud
domain='seriouslyruby.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' /> <item><title>Pragmatic Guide to JavaScript</title><link>http://www.pragprog.com/news/pragmatic-guide-to-javascript</link> <comments>http://www.pragprog.com/news/pragmatic-guide-to-javascript#comments</comments> <pubDate>Wed, 08 Sep 2010 14:30:21 +0000</pubDate> <dc:creator>Andrew Hunt</dc:creator> <category><![CDATA[Publishers]]></category><guid
isPermaLink="false">http://www.pragprog.com/news/pragmatic-guide-to-javascript?1219103</guid> <description><![CDATA[<div><p>The latest member of our new <em>Pragmatic Guide Series</em> is now available in beta: <em>Pragmatic Guide to JavaScript</em></p></div>]]></description> <content:encoded><![CDATA[<div
id="cms-content"><p>The latest member of our new <em>Pragmatic Guide Series</em> is now available in beta: <em>Pragmatic Guide to JavaScript</em></p></p></div><p> <script type="text/javascript">/*<![CDATA[*/// 
        new LoginCheck();
        // ]]&gt;/*]]>*/</script></p> ]]></content:encoded> <wfw:commentRss>http://seriouslyruby.com/2010/09/08/07/30/21/pragmatic-guide-to-javascript/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Ruby Gurus to blog on RubyLearning</title><link>http://rubylearning.com/blog/2010/09/08/ruby-gurus-to-blog-on-rubylearning/</link> <comments>http://rubylearning.com/blog/2010/09/08/ruby-gurus-to-blog-on-rubylearning/#comments</comments> <pubDate>Wed, 08 Sep 2010 04:02:47 +0000</pubDate> <dc:creator>Satish Talim</dc:creator> <category><![CDATA[Publishers]]></category> <category><![CDATA[Ruby Learning Blog]]></category> <category><![CDATA[Beginners]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[ruby]]></category> <category><![CDATA[ruby gurus]]></category> <category><![CDATA[Ruby Masters]]></category> <category><![CDATA[Ruby Newbies]]></category><guid
isPermaLink="false">http://rubylearning.com/blog/?p=4442</guid> <description><![CDATA[Ruby Gurus to blog on RubyLearning RubyLearning is happy to announce that the following Ruby Gurus would be individually writing a guest blog post here starting 20th Sept. 2010. The focus of the blog post would be towards Ruby Newbies. These gurus are: 20th Sept. &#8211; Geoffrey Grosenbach, USA. 21st Sept. &#8211; Sau Sheong Chang, [...]]]></description> <content:encoded><![CDATA[</p><div><h3>Ruby Gurus to blog on RubyLearning</h3><p>RubyLearning is happy to announce that the following Ruby Gurus would be individually writing a guest blog post here starting 20th Sept. 2010. The focus of the blog post would be towards <em>Ruby Newbies</em>. These gurus are:</p><ul><li>20th Sept. &#8211; <a
href="http://geoffreygrosenbach.com/">Geoffrey Grosenbach</a>, USA.</li><li>21st Sept. &#8211; <a
href="https://www.packtpub.com/cloning-internet-applications-with-ruby/book">Sau Sheong Chang</a>, Singapore.</li><li>22nd Sept. &#8211; <a
href="http://railsdeveloper.com/d/jschoolcraft">Jeff Schoolcraft</a>, USA.</li><li>23rd Sept. &#8211; <a
href="http://blog.dudeblake.com/">Karmen Blake</a>, USA.</li><li>24th Sept. &#8211; <a
href="http://rock-n-code.com/">Julio Javier Cicchelli</a>, Netherlands.</li><li>25th Sept. &#8211; <a
href="http://www.compleatrubyist.com/">David A. Black</a>, USA.</li><li>27th Sept. &#8211; <a
href="http://merbist.com/">Matt Aimonetti</a>, USA.</li><li>28th Sept. &#8211; <a
href="http://www.beyondthetype.com/">Martin Sadler</a>, UK.</li><li>29th Sept. &#8211; <a
href="http://railsrx.com/">Noel Rappin</a>, USA.</li><li>30th Sept. &#8211; <a
href="http://dctanner.co.uk/">Damien Tanner</a>, UK.</li><li>1st Oct. &#8211; <a
href="http://jabberwocky.eu/">Elise Huard</a>, Belgium.</li></ul><p>More blog posts from other Ruby Gurus are in the pipeline.</p><p>Watch this space.</p></div><p>Technorati Tags: <a
href="http://technorati.com/tag/Ruby+Gurus" rel="tag">Ruby Gurus</a>, <a
href="http://technorati.com/tag/Ruby" rel="tag">Ruby</a>, <a
href="http://technorati.com/tag/Programming" rel="tag">Programming</a>, <a
href="http://technorati.com/tag/Ruby+Newbies" rel="tag"> Ruby Newbies</a></p><div
class="feedflare"> <a
href="http://feeds.feedburner.com/~ff/LearningRubyBlog?a=QNOvgZE-J2I:giWk2vRjoDE:yIl2AUoC8zA"><img
src="http://feeds.feedburner.com/~ff/LearningRubyBlog?d=yIl2AUoC8zA" border="0"></img></a> <a
href="http://feeds.feedburner.com/~ff/LearningRubyBlog?a=QNOvgZE-J2I:giWk2vRjoDE:MclgosYkiZA"><img
src="http://feeds.feedburner.com/~ff/LearningRubyBlog?i=QNOvgZE-J2I:giWk2vRjoDE:MclgosYkiZA" border="0"></img></a></div> ]]></content:encoded> <wfw:commentRss>http://rubylearning.com/blog/2010/09/08/ruby-gurus-to-blog-on-rubylearning/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Automatic Flushing: The Rails 3.1 Plan</title><link>http://feedproxy.google.com/~r/KatzGotYourTongue/~3/RU9BuoerKvo/</link> <comments>http://feedproxy.google.com/~r/KatzGotYourTongue/~3/RU9BuoerKvo/#comments</comments> <pubDate>Wed, 08 Sep 2010 01:05:34 +0000</pubDate> <dc:creator>wycats</dc:creator> <category><![CDATA[Publishers]]></category><guid
isPermaLink="false">http://yehudakatz.com/?p=545</guid> <description><![CDATA[preamble: this post explains, in some detail, how we will implement a nice performance boost for Rails developers. Understanding the details might help gain the full benefits of the optimization, but you will gain some benefits even if you have no idea how it works. As you&#8217;ve probably seen, DHH announced that we&#8217;d be looking [...]]]></description> <content:encoded><![CDATA[<p><strong>preamble</strong>: this post explains, in some detail, how we will implement a nice performance boost for Rails developers. Understanding the details might help gain the full benefits of the optimization, but you will gain some benefits even if you have no idea how it works.</p><p>As you&#8217;ve probably seen, DHH announced that we&#8217;d be looking at flushing in Rails 3.1 to improve the client-side performance of typical Rails applications.</p><p>The most obvious solution, and one that already exists in <a
href="http://github.com/oggy/template_streaming">plugin form</a>, is to allow a layout to have a new <code>flush</code> method, which would immediately flush the contents of the layout to the browser. By putting the <code>flush</code> method below the JavaScript and CSS includes, the browser could begin downloading and evaluating those static assets while the server continues building the page.</p><p>Unfortunately, this solution has a major problem: it requires a fairly significant change in the current model of how people build applications. In general, for performance optimizations (including client-side optimizations), we like to make the default as fast as possible, without asking people to understand a brand new paradigm, centered around the optimization.</p><p>The problem lies in the fact that a Rails layout is essentially a template with a bunch of holes to fill in.</p><div
class="wp_syntax"><div
class="code"><pre class="erb" style="font-family:monospace;">&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;&lt;%= yield :title %&gt;&lt;/title&gt;
    &lt;%= javascript_include_tag :defaults %&gt;
    &lt;%= yield :extra_javascripts %&gt;
    &lt;%= stylesheet_link_tag :defaults %&gt;
    &lt;%= yield :extra_stylesheets %&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;%= yield :sidebar %&gt;
    &lt;%= yield %&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre></div></div><p>I this simple example, each <code>yield</code> is a slot that is filled in by the template (usually via <code>content_for</code>). In order to achieve this, Rails evaluates the template first, which populates a Hash with each piece of content. Next, it renders the layout, and each <code>yield</code> checks the Hash for that content. In short, because of the way layouts work, Rails renders the template first, and then the layout.</p><p>To get around this, one option would be to say that everything before the <code>flush</code> must not use <code>yield</code>, and must be able to run before the template. Unfortunately, it&#8217;s somewhat common for people to set up a <code>content_for(:javascripts)</code> in a template, to keep the JavaScript needed for a particular snippet of HTML close to the HTML. This means that not only does the user have to be careful about what can go above and below the <code>flush</code>, he can no longer use <code>content_for</code> for things high up in the template, which is a fairly significant change to the overall design of Rails applications.</p><p>For Rails 3.1, we wanted a mostly-compatible solution with the same programmer benefits as the existing model, but with all the benefits of automatic flushing. After a number of very long discussions on the topic, José Valim came up with the idea of using Ruby 1.9 fibers to jump back and forth between the template and layout.</p><p>Let&#8217;s start by taking a look at a very simplified version of the current Rails rendering pipeline. First, we set up a Buffer object purely for logging purposes, so we can see what&#8217;s happening as we push things onto the buffer.</p><div
class="wp_syntax"><div
class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> Basic
  <span style="color:#9966CC; font-weight:bold;">class</span> Buffer <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#CC0066; font-weight:bold;">String</span>
    <span style="color:#9966CC; font-weight:bold;">def</span> initialize<span style="color:#006600; font-weight:bold;">&#40;</span>name, context<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#0066ff; font-weight:bold;">@name</span>    = name
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span><span style="color:#006600; font-weight:bold;">&#40;</span>value<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">super</span>
&nbsp;
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;#{@name} is pushing #{value.inspect}&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div><p>Next, we create a simple version of <code>ActionView::Base</code>. We implement the <code>content_for</code> method simply, to print out a bit of logging information and stash the value into the <code>@content_for</code> Hash. Note that the real version is pretty similar, with some added logic for capturing the value of the block from ERB.</p><div
class="wp_syntax"><div
class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> Basic
  <span style="color:#9966CC; font-weight:bold;">class</span> ViewContext
    <span style="color:#9966CC; font-weight:bold;">def</span> initialize
      <span style="color:#0066ff; font-weight:bold;">@buffer</span>      = Buffer.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:main</span>, <span style="color:#0000FF; font-weight:bold;">self</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#0066ff; font-weight:bold;">@content_for</span> = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> content_for<span style="color:#006600; font-weight:bold;">&#40;</span>name, value = <span style="color:#0000FF; font-weight:bold;">nil</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      value = <span style="color:#9966CC; font-weight:bold;">yield</span> <span style="color:#9966CC; font-weight:bold;">if</span> block_given?
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Setting #{name} to #{value.inspect}&quot;</span>
      <span style="color:#0066ff; font-weight:bold;">@content_for</span><span style="color:#006600; font-weight:bold;">&#91;</span>name<span style="color:#006600; font-weight:bold;">&#93;</span> = value
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> read_content<span style="color:#006600; font-weight:bold;">&#40;</span>name<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#0066ff; font-weight:bold;">@content_for</span><span style="color:#006600; font-weight:bold;">&#91;</span>name<span style="color:#006600; font-weight:bold;">&#93;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div><p>Next, we create a number of methods on the <code>ViewContext</code> that look like compiled ERB templates. In real life, the ERB (or Haml) compiler would define these methods.</p><div
class="wp_syntax"><div
class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> Basic
  <span style="color:#9966CC; font-weight:bold;">class</span> ViewContext
    <span style="color:#9966CC; font-weight:bold;">def</span> layout
      <span style="color:#0066ff; font-weight:bold;">@buffer</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot;&lt;html&gt;&lt;head&gt;&quot;</span>
      <span style="color:#0066ff; font-weight:bold;">@buffer</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#9966CC; font-weight:bold;">yield</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:javascripts</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to_s</span>
      <span style="color:#0066ff; font-weight:bold;">@buffer</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#9966CC; font-weight:bold;">yield</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:stylesheets</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to_s</span>
      <span style="color:#0066ff; font-weight:bold;">@buffer</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot;&lt;/head&gt;&lt;body&gt;&quot;</span>
      <span style="color:#0066ff; font-weight:bold;">@buffer</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#9966CC; font-weight:bold;">yield</span>.<span style="color:#9900CC;">to_s</span>
      <span style="color:#0066ff; font-weight:bold;">@buffer</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#9966CC; font-weight:bold;">yield</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:not_existant</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to_s</span>
      <span style="color:#0066ff; font-weight:bold;">@buffer</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot;&lt;/body&gt;&lt;/html&gt;&quot;</span>
      <span style="color:#0066ff; font-weight:bold;">@buffer</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> template
      buffer =  Buffer.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:template</span>, <span style="color:#0000FF; font-weight:bold;">self</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      content_for<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:javascripts</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        <span style="color:#996600;">&quot;&lt;script src='application.js'&gt;&lt;/script&gt;&quot;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
      content_for<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:stylesheets</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        <span style="color:#996600;">&quot;&lt;link href='application.css' rel='stylesheet' /&gt;&quot;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Making a SQL call&quot;</span>
      <span style="color:#CC0066; font-weight:bold;">sleep</span> <span style="color:#006666;">1</span> <span style="color:#008000; font-style:italic;"># Emulate a slow SQL call</span>
      buffer <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot;Hello world!&quot;</span>
      content_for<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:body</span>, buffer<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div><p>Finally, we define the basic rendering logic:</p><div
class="wp_syntax"><div
class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> Basic
  <span style="color:#9966CC; font-weight:bold;">class</span> ViewContext
    <span style="color:#9966CC; font-weight:bold;">def</span> render
      template
      layout <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>value<span style="color:#006600; font-weight:bold;">|</span> read_content<span style="color:#006600; font-weight:bold;">&#40;</span>value <span style="color:#006600; font-weight:bold;">||</span> <span style="color:#ff3333; font-weight:bold;">:body</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div><p>As you can see, we first render the template, which will fill up the <code>@content_for</code> Hash, and then call the layout method, with a block which pulls the value from that Hash. This is how <code>yield :javascripts</code> in a layout works.</p><p>Unfortunately, this means that the entire template must be rendered first, including the (fake) slow SQL query. We&#8217;d prefer to flush the buffer after the JavaScripts and CSS are determined, but before the SQL query is made. Unfortunately, that requires running half of the template method, then continuing with the layout method, retaining the ability to resume the template method later.</p><p>You can think of the way that templates are currently rendered (in Rails 2.x and 3.0) like this:</p><p><img
src="http://yehudakatz.com/wp-content/uploads/2010/09/flush.001.png" alt="flush.001.png" border="0" width="600" height="450" /></p><p>Unfortunately, this makes it very hard to get any more performance juice out without asking the end-developer to make some hard choices. The solution we came up with is to use Ruby 1.9 fibers to allow the rendering to jump back and forth between the template and layout.</p><p><img
src="http://yehudakatz.com/wp-content/uploads/2010/09/flush.002.png" alt="flush.002.png" border="0" width="600" height="450" /></p><p>Instead of starting with the template and only rendering the layout when ready, we&#8217;ll start with the layout, and jump over to the template when a <code>yield</code> is called. Once the <code>content_for</code> that piece is provided by the template, we can jump back to the layout, flush, and continue rendering. As we need more pieces, we can jump back and forth between the template and layout, flushing as we fill in the holes specified by the <code>yield</code> statements.</p><p>The implementation is mostly straight-forward:</p><div
class="wp_syntax"><div
class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">&quot;fiber&quot;</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">module</span> Fibered
  <span style="color:#9966CC; font-weight:bold;">class</span> ViewContext <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">Basic::ViewContext</span>
    <span style="color:#9966CC; font-weight:bold;">def</span> initialize
      <span style="color:#9966CC; font-weight:bold;">super</span>
      <span style="color:#0066ff; font-weight:bold;">@waiting_for</span> = <span style="color:#0000FF; font-weight:bold;">nil</span>
      <span style="color:#0066ff; font-weight:bold;">@fiber</span>       = <span style="color:#0000FF; font-weight:bold;">nil</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> content_for<span style="color:#006600; font-weight:bold;">&#40;</span>name, value = <span style="color:#0000FF; font-weight:bold;">nil</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">super</span>
      <span style="color:#0066ff; font-weight:bold;">@fiber</span>.<span style="color:#9900CC;">resume</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0066ff; font-weight:bold;">@waiting_for</span> == name
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> read_content<span style="color:#006600; font-weight:bold;">&#40;</span>name<span style="color:#006600; font-weight:bold;">&#41;</span>
      content = <span style="color:#9966CC; font-weight:bold;">super</span>
      <span style="color:#0000FF; font-weight:bold;">return</span> content <span style="color:#9966CC; font-weight:bold;">if</span> content
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">begin</span>
        <span style="color:#0066ff; font-weight:bold;">@waiting_for</span> = name
        Fiber.<span style="color:#9966CC; font-weight:bold;">yield</span>
      <span style="color:#9966CC; font-weight:bold;">ensure</span>
        <span style="color:#0066ff; font-weight:bold;">@waiting_for</span> = <span style="color:#0000FF; font-weight:bold;">nil</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">super</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> layout
      <span style="color:#0066ff; font-weight:bold;">@fiber</span> = Fiber.<span style="color:#9900CC;">new</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        <span style="color:#9966CC; font-weight:bold;">super</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
      <span style="color:#0066ff; font-weight:bold;">@fiber</span>.<span style="color:#9900CC;">resume</span>
      <span style="color:#0066ff; font-weight:bold;">@buffer</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> render
      layout <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>value<span style="color:#006600; font-weight:bold;">|</span> read_content<span style="color:#006600; font-weight:bold;">&#40;</span>value <span style="color:#006600; font-weight:bold;">||</span> <span style="color:#ff3333; font-weight:bold;">:body</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
      template
      <span style="color:#0066ff; font-weight:bold;">@fiber</span>.<span style="color:#9900CC;">resume</span> <span style="color:#9966CC; font-weight:bold;">while</span> <span style="color:#0066ff; font-weight:bold;">@fiber</span>.<span style="color:#9900CC;">alive</span>?
      <span style="color:#0066ff; font-weight:bold;">@buffer</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div><p>For our fibered implementation, we&#8217;ll inherit from <code>Basic::ViewContext</code>, because we want to be able to use the same templates as we used in the original implementation. We update the <code>content_for</code>, <code>read_content</code>, <code>layout</code> and <code>render</code> methods to be fiber-aware. Let&#8217;s take them one at a time.</p><div
class="wp_syntax"><div
class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> layout
  <span style="color:#0066ff; font-weight:bold;">@fiber</span> = Fiber.<span style="color:#9900CC;">new</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#9966CC; font-weight:bold;">super</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#0066ff; font-weight:bold;">@fiber</span>.<span style="color:#9900CC;">resume</span>
  <span style="color:#0066ff; font-weight:bold;">@buffer</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div><p>First, we wrap the original implementation of layout in a Fiber, and start it right away. Next, we modify the <code>read_content</code> method to become Fiber-aware:</p><div
class="wp_syntax"><div
class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> read_content<span style="color:#006600; font-weight:bold;">&#40;</span>name<span style="color:#006600; font-weight:bold;">&#41;</span>
  content = <span style="color:#9966CC; font-weight:bold;">super</span>
  <span style="color:#0000FF; font-weight:bold;">return</span> content <span style="color:#9966CC; font-weight:bold;">if</span> content
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">begin</span>
    <span style="color:#0066ff; font-weight:bold;">@waiting_for</span> = name
    Fiber.<span style="color:#9966CC; font-weight:bold;">yield</span>
  <span style="color:#9966CC; font-weight:bold;">ensure</span>
    <span style="color:#0066ff; font-weight:bold;">@waiting_for</span> = <span style="color:#0000FF; font-weight:bold;">nil</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">super</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div><p>If the <code>@content_for</code> Hash already has the content, return it right away. Otherwise, say that we&#8217;re waiting for the key in question, and yield out of the Fiber. We modify the <code>render</code> method so that the layout is rendered first, followed by the template. As a result, yielding out of the layout will start the template&#8217;s rendering.</p><div
class="wp_syntax"><div
class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> render
  layout <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>value<span style="color:#006600; font-weight:bold;">|</span> read_content<span style="color:#006600; font-weight:bold;">&#40;</span>value <span style="color:#006600; font-weight:bold;">||</span> <span style="color:#ff3333; font-weight:bold;">:body</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
  template
  <span style="color:#0066ff; font-weight:bold;">@fiber</span>.<span style="color:#9900CC;">resume</span> <span style="color:#9966CC; font-weight:bold;">while</span> <span style="color:#0066ff; font-weight:bold;">@fiber</span>.<span style="color:#9900CC;">alive</span>?
  <span style="color:#0066ff; font-weight:bold;">@buffer</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div><p>Next, modify the <code>content_for</code> method so that when the content we&#8217;re waiting for is provided, we jump back into the layout.</p><div
class="wp_syntax"><div
class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> content_for<span style="color:#006600; font-weight:bold;">&#40;</span>name, value = <span style="color:#0000FF; font-weight:bold;">nil</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">super</span>
  <span style="color:#0066ff; font-weight:bold;">@fiber</span>.<span style="color:#9900CC;">resume</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0066ff; font-weight:bold;">@waiting_for</span> == name
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div><p>With this setup, the layout and template will ping-pong back and forth, with the layout requesting data, and the template rendering only as far as it needs to go to provide the data requested.</p><p>Finally, let&#8217;s update the Buffer to take our fibered implementation into consideration.</p><div
class="wp_syntax"><div
class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> Basic
  <span style="color:#9966CC; font-weight:bold;">class</span> Buffer <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#CC0066; font-weight:bold;">String</span>
    <span style="color:#9966CC; font-weight:bold;">def</span> initialize<span style="color:#006600; font-weight:bold;">&#40;</span>name, context<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#0066ff; font-weight:bold;">@name</span>    = name
      <span style="color:#0066ff; font-weight:bold;">@fibered</span> = context.<span style="color:#9900CC;">fibered</span>?
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span><span style="color:#006600; font-weight:bold;">&#40;</span>value<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">super</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0066ff; font-weight:bold;">@fibered</span>
        <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Flushing #{value.inspect}&quot;</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0066ff; font-weight:bold;">@fibered</span>
      <span style="color:#9966CC; font-weight:bold;">else</span>
        <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;#{@name} is pushing #{value.inspect}&quot;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">class</span> ViewContext
    <span style="color:#9966CC; font-weight:bold;">def</span> fibered?
      <span style="color:#0000FF; font-weight:bold;">false</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">module</span> Fibered
  <span style="color:#9966CC; font-weight:bold;">class</span> ViewContext
    <span style="color:#9966CC; font-weight:bold;">def</span> fibered?
      <span style="color:#0000FF; font-weight:bold;">true</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div><p>Now that we&#8217;re rendering the layout in order, we can flush as we go, instead of being forced to wait for the entire template to render before we can start flushing.</p><p>It&#8217;s worth mentioning that optimal flushing performance will be based on the order of the <code>content_for</code> in your template. If you run your queries first, then put the expensive template rendering, and only finally do the <code>content_for(:javascript)</code> at the end, the flushing behavior will look like this:</p><p><img
src="http://yehudakatz.com/wp-content/uploads/2010/09/flush.003.png" alt="flush.003.png" border="0" width="600" height="450" /></p><p>Instead of flushing quickly, before the SQL call, things are barely better than they are in Rails 2.3, when the entire template must be rendered before the first flush. Because things are no worse, even in the worst-case scenario, we can make this the default behavior. Most people will see some benefit from it, and people interested in the best performance can order their <code>content_for</code> blocks so they cause the most beneficial flushing.</p><p>Even for people willing to put in the effort, this API is better than forcing a manual flush, because you can still put your <code>content_for</code> blocks alongside the templates that they are related to.</p><p>Look for this feature in Rails 3.1!</p><h2>Small Caveat</h2><p>For the purposes of this simplified example, I assumed that <code>content_for</code> can only be run once, immediately setting the value in the <code>@content_for</code> Hash. However, in some cases, people want to accumulate a String for a particular value. Obviously, we won&#8217;t be able to flush until the full String for that value is accumulated.</p><p>As a result, we&#8217;ll be adding a new API (likely called <code>provide</code>), which will behave exactly the same as <code>content_for</code>, but without the ability to accumulate. In the vast majority of cases, people will want to use <code>provide</code> (for instance, <code>provide :sidebar</code>), and get all the benefits of autoflushing. In a few cases, people will want to be able to continue accumulating a String, and will still be able to use <code>content_for</code>, but the template will not return control to the layout when that happens.</p><p>Also note that this (fairly detailed) explanation is not something that you will need to understand as a Rails developer. Instead, you will continue to go about your development as before, using <code>provide</code> if you have just a single piece of content to add, and <code>content_for</code> if you have multiple pieces of content to add, and Rails will automatically optimize flushing for you as well as we can.</p><p><script type="text/javascript">addthis_url    = 'http%3A%2F%2Fyehudakatz.com%2F2010%2F09%2F07%2Fautomatic-flushing-the-rails-3-1-plan%2F';
  addthis_title  = 'Automatic+Flushing%3A+The+Rails+3.1+Plan';
  addthis_pub    = '';</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script></p><div
class="feedflare"> <a
href="http://feeds.feedburner.com/~ff/KatzGotYourTongue?a=RU9BuoerKvo:brSzbKnguhs:yIl2AUoC8zA"><img
src="http://feeds.feedburner.com/~ff/KatzGotYourTongue?d=yIl2AUoC8zA" border="0"></img></a></div><p><img
src="http://feeds.feedburner.com/~r/KatzGotYourTongue/~4/RU9BuoerKvo" height="1" width="1"/></p> ]]></content:encoded> <wfw:commentRss>http://yehudakatz.com/2010/09/07/automatic-flushing-the-rails-3-1-plan/feed/atom/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>The Ruby Show #132: There Be Dragons</title><link>http://feedproxy.google.com/~r/railsenvy-podcast/~3/PfDyTrIayeI/132</link> <comments>http://feedproxy.google.com/~r/railsenvy-podcast/~3/PfDyTrIayeI/132#comments</comments> <pubDate>Tue, 07 Sep 2010 22:31:00 +0000</pubDate> <dc:creator>Jason Seifer and Dan Benjamin</dc:creator> <category><![CDATA[Publishers]]></category><guid
isPermaLink="false">http://5by5.tv/rubyshow/132</guid> <description><![CDATA[In this episode, Jason and Dan bring you the latest Ruby and Rails news. They touch on the latest 2.x release of rails, an awesome css plugin, and of course, code from the GitHubs.]]></description> <content:encoded><![CDATA[<p>In this episode, Jason and Dan bring you the latest Ruby and Rails news. They touch on the latest 2.x release of rails, an awesome css plugin, and of course, code from the GitHubs.<img
src="http://feeds.feedburner.com/~r/railsenvy-podcast/~4/PfDyTrIayeI" height="1" width="1"/></p> ]]></content:encoded> <wfw:commentRss>http://seriouslyruby.com/2010/09/07/15/31/00/the-ruby-show-132-there-be-dragons/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <enclosure
url="http://feedproxy.google.com/~r/railsenvy-podcast/~5/PQnH9dq9b00/rubyshow-132.mp3" length="11033413" type="audio/mpeg" /> </item> <item><title>September 7, 2010: On Writing Bad Code</title><link>http://feedproxy.google.com/~r/railsprescriptions/~3/G26pCJ-apK8/</link> <comments>http://feedproxy.google.com/~r/railsprescriptions/~3/G26pCJ-apK8/#comments</comments> <pubDate>Tue, 07 Sep 2010 12:38:00 +0000</pubDate> <dc:creator>noelrap</dc:creator> <category><![CDATA[Publishers]]></category><guid
isPermaLink="false">https://railsrx.wordpress.com/?p=245</guid> <description><![CDATA[I&#8217;ve been working on my tutorial session for WindyCityRails (tickets still available&#8230;). The session is about how to test when you are working in a legacy app that doesn&#8217;t have tests. Naturally, that requires some legacy code for the attendees to work with during the tutorial. My own worst Rails messes are either back in [...]<img
alt="" border="0" src="http://stats.wordpress.com/b.gif?host=railsrx.com&#38;blog=10160445&#38;post=245&#38;subd=railsrx&#38;ref=&#38;feed=1" width="1" height="1" />]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been working on my tutorial session for <a
href="http://windycityrails.org/">WindyCityRails</a> (<a
href="http://windycityrails.org/register/">tickets still available</a>&#8230;). The session is about how to test when you are working in a legacy app that doesn&#8217;t have tests.</p><p>Naturally, that requires some legacy code for the attendees to work with during the tutorial. My own worst Rails messes are either back in the 1.2.x time frame or I don&#8217;t have access to them any more. I don&#8217;t have the right to distribute legacy code that I have inherited, and most of those people wouldn&#8217;t want me calling their code a junkpile in public.</p><p>So I&#8217;ve been writing a faux-legacy application, or at least enough of one to make the needed points in the tutorial. The idea stumped me for a bit because the app needs to be both complex enough to plausibly show the issues in legacy testing and simple enough so that setup and changes can actually happen in a short workshop.</p><p>Eventually, I hit on the following guidelines for writing deliberately bad code:</p><ul><li>Aggressive corner cutting on features that aren&#8217;t essential to the presentation.</li><li>Don&#8217;t look anything up and don&#8217;t use gems or plugins, not least of which to prevent setup issues.</li><li>Make no effort to put things in the &#8220;right&#8221; place.</li><li>Work quickly, without design and never go back to clean up a mess.</li><li>Randomly, do something a little bit less elegantly than normal. Oh, and some metaprogrammy Ruby things were off limits, assuming I was writing as somebody who didn&#8217;t know Ruby that well.</li></ul><p>And I think I got some nicely tangled code rather quickly.</p><p>At this point I think I&#8217;m supposed to say one of two things:</p><ul><li>Boy I sure was able to write that code fast without the pesky rules! I guess that TDD stuff isn&#8217;t that great after all.</li><li>Boy, I sure wrote nasty code without those pesky rules! I guess that TDD stuff really is great after all.</li></ul><p>I think I believe the second point more than the first. It&#8217;s hard to look at this code and not see some major pain coming in the future. That said, you have to acknowledge the emotional power of seeming to write fast code.</p><p>Because I did go pretty fast here, and I got a satisfying amount of app built in a relatively short number of hours with a very continuous novelty burst in my head from seeing new things in a browser.</p><p>The temptation to say, &#8220;I was deliberately writing ugly code. If I just stopped doing that, then boy, I could go really fast and not use TDD, I can control bugs without TDD.&#8221; And the thing is, that&#8217;ll be true for a while. Maybe a long time, if you&#8217;re pretty good and working by yourself.</p><p>This is related to the very seductive idea that your project <a
href="http://railsrx.com/2010/01/03/the-agile-bet/">doesn&#8217;t need to use Agile</a> methods because you can control your changes up front. In both cases, you go quickly mostly by ignoring the inevitability of anything changing in the future (who cares how tangled the code is if nobody ever has to modify it&#8230;)</p><p>In the end, though, change is coming. So the trick to working in a legacy environment is taking code that was never written to allow change and making it more amenable to change.</p><p>Filed under: <a
href='http://railsrx.com/category/agile/'>Agile</a> <a
rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/railsrx.wordpress.com/245/"><img
alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/railsrx.wordpress.com/245/" /></a> <a
rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/railsrx.wordpress.com/245/"><img
alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/railsrx.wordpress.com/245/" /></a> <a
rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/railsrx.wordpress.com/245/"><img
alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/railsrx.wordpress.com/245/" /></a> <a
rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/railsrx.wordpress.com/245/"><img
alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/railsrx.wordpress.com/245/" /></a> <a
rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/railsrx.wordpress.com/245/"><img
alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/railsrx.wordpress.com/245/" /></a> <a
rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/railsrx.wordpress.com/245/"><img
alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/railsrx.wordpress.com/245/" /></a> <a
rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/railsrx.wordpress.com/245/"><img
alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/railsrx.wordpress.com/245/" /></a> <img
alt="" border="0" src="http://stats.wordpress.com/b.gif?host=railsrx.com&amp;blog=10160445&amp;post=245&amp;subd=railsrx&amp;ref=&amp;feed=1" width="1" height="1" /><div
class="feedflare"> <a
href="http://feeds.feedburner.com/~ff/railsprescriptions?a=G26pCJ-apK8:n00sSgx2Fxw:yIl2AUoC8zA"><img
src="http://feeds.feedburner.com/~ff/railsprescriptions?d=yIl2AUoC8zA" border="0"></img></a> <a
href="http://feeds.feedburner.com/~ff/railsprescriptions?a=G26pCJ-apK8:n00sSgx2Fxw:V_sGLiPBpWU"><img
src="http://feeds.feedburner.com/~ff/railsprescriptions?i=G26pCJ-apK8:n00sSgx2Fxw:V_sGLiPBpWU" border="0"></img></a> <a
href="http://feeds.feedburner.com/~ff/railsprescriptions?a=G26pCJ-apK8:n00sSgx2Fxw:F7zBnMyn0Lo"><img
src="http://feeds.feedburner.com/~ff/railsprescriptions?i=G26pCJ-apK8:n00sSgx2Fxw:F7zBnMyn0Lo" border="0"></img></a></div><p><img
src="http://feeds.feedburner.com/~r/railsprescriptions/~4/G26pCJ-apK8" height="1" width="1"/></p> ]]></content:encoded> <wfw:commentRss>http://railsrx.com/2010/09/07/september-7-2010-on-writing-bad-code/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <enclosure
url="http://0.gravatar.com/avatar/6b767d8a4c9910e007c122d81eb4de73?s=96&amp;amp;d=&amp;amp;r=G" length="" type="" /> </item> <item><title>Episode 230: Inherited Resources</title><link>http://railscasts.com/episodes/230-inherited-resources</link> <comments>http://railscasts.com/episodes/230-inherited-resources#comments</comments> <pubDate>Mon, 06 Sep 2010 07:00:00 +0000</pubDate> <dc:creator>Ryan Bates</dc:creator> <category><![CDATA[Publishers]]></category><guid
isPermaLink="false">http://inherited-resources</guid> <description><![CDATA[Inherited Resource simplifies RESTful controllers by providing default actions which can be customized through inheritance.]]></description> <content:encoded><![CDATA[<p>Inherited Resource simplifies RESTful controllers by providing default actions which can be customized through inheritance.</p> ]]></content:encoded> <wfw:commentRss>http://seriouslyruby.com/2010/09/06/00/00/00/episode-230-inherited-resources/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <enclosure
url="http://media.railscasts.com/videos/230_inherited_resources.mov" length="15856846" type="video/quicktime" /> </item> <item><title>Matz Ruby World Keynote</title><link>http://www.chadfowler.com/2010/9/6/matz-ruby-world-keynote</link> <comments>http://www.chadfowler.com/2010/9/6/matz-ruby-world-keynote#comments</comments> <pubDate>Mon, 06 Sep 2010 05:20:00 +0000</pubDate> <dc:creator>chad</dc:creator> <category><![CDATA[Publishers]]></category><guid
isPermaLink="false"></guid> <description><![CDATA[
The following is my real time transcription of the translation of Matz’s speech at Ruby World 2010.  I was typing as fast as I could while he spoke, and I probably made some mistakes. I might have left out some words or sentences. If any...]]></description> <content:encoded><![CDATA[<p>The following is my real time transcription of the translation of <a
href="http://www.rubyist.net/~matz/">Matz’s</a> speech at <a
href="http://www.rubyworld-conf.org">Ruby World 2010</a>.  I was typing as fast as I could while he spoke, and I probably made some mistakes. I might have left out some words or sentences. If anything doesn’t make sense, assume it’s my fault and not Matsumoto-san’s. Anyway, I enjoyed Matz’s keynote and thought other English speakers might like a chance to see what he said.</p><h2>I’m Matsumoto</h2><p>I Started Ruby in 1993 at NaCL:http://www.netlab.jp/. When I joined the company after graduating from college, I didn’t have much to do at the time. I was not fired fortunately. But I had plenty of time so I started to work on Ruby as a side project.</p><p>So at the time, there was <span
class="caps">ONE</span> user of Ruby. Then I started to develop Ruby with some other friends.</p><p>In 1995, Ruby was released and distributed over the internet for general use. At the time, people on usenet got interested in Ruby and gave me some feedback. Also we used a mailing list to distribute information on Ruby.</p><p>So within days, about 200 people got involved. So in 1995, the number of people who knew something about Ruby was about 200.</p><p>Even after that, Ruby was known to a relatively limited number of people.</p><p>Then in 1999, I published a book called Object Oriented Scripting with Ruby. This was the first book on Ruby. It’s only natural. Who else is going to write a book on Ruby, right??</p><p>At the time, this sold pretty well. Cumulatively, we sold almost 20,000 copies. I’m sure I’m allowed to discuss this number. Probably it’s only 17,000 in real numbers. This was in Japanese, so Ruby was known to the whole nation. So in 1999, Ruby was known to a lot more people. More engineers and programmers knew about the language.</p><p>I started to hear from many people that they knew about Ruby.</p><p>In year 2000, <a
href="http://www.pragprog.com/titles/ruby/programming-ruby">a book in English</a> was published.  Many people in the world came to know about Ruby.</p><p>Then in 2004, <a
href="http://rubyonrails.org">Ruby on Rails</a> was released. Of course, most people know about this Web application framework. Ruby on Rails is very productive compared to competing frameworks in other languages.  There was an active discussion on the comparison of performance. It was welcomed by many people. We estimate that the number of users grew to 100,000 people in 2004.</p><p>In 2008, US-based Gartner released a survey. In the report, Gartner estimated that the total number of Ruby users reached 1,000,000. This was a huge number as you can see.</p><p>In the same report, the reporter predicted that in five years (2013)  the total number of users would be 4,000,000.  Ruby is open source. You don’t have to pay anything to use it. You just download it. It is therefore very difficult to know how many people are using it. I created Ruby myself and I don’t know how many people are using it, so I’m not sure how Gartner reached their conclusion.  But anyway, 4,000,000 people are predicted to be using Ruby in 2013.</p><p>So in 20 years, this project which started with one person may have increased from 1 to 4,000,000 users. This is beyond the normal growth rate of a technology.</p><p>This period of Ruby’s popularity was due to the popularity of Ruby on Rails.</p><p>There is a ccompany called <a
href="http://www.tiobe.com/">Tiobe Software</a> which is a software company in the US. Their <a
href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html">Tiobe Index</a> rates the popularity of programming languages using Google, Yahoo, Microsoft, and other search engines to rate the popularity of languages on the internet. Back in 2009, according to Tiobe index, Ruby was ranked #10. And in 2008, it was ranked #9.</p><p>In this year, 2010, it was demoted to #12.</p><p>You may have a concern about the future of Ruby, but if you drill down deeper, you will see: objective-c is getting more popular, driven by iPad, iPod, etc. development. Objective-C is required.  So it jumped form 42 to 11.  And Go by Google was released in April of last year. So where it didn’t exist previously it jumped up to #15.</p><p>As you can see, Ruby represents 2.221% of programming language references according to Tiobe.  That’s good.</p><p>So don’t have a concern about this.</p><p>But this marks a very interesting symptom. The end of the ruby “bubble”. When I joined the company, the bubble economy was still there. Then it collapsed and caused a lot of trouble. A “bubble” is not sustainable. Bubbles are therefore undesirable.</p><p>There are many comedians and musicians named as “one-hit wonders”. I don’t want Ruby to become that.</p><p>The life expectancy of a programming language is pretty long. Fortran was created in the 1950s. I want Ruby to be like this. That’s why this presentation is called “Sustainable Ruby”.  The question is how to maintain Ruby’s high level of quality and the high level of quality of the people.</p><p>So in order to implement “sustainable ruby”, we must first discuss the benefit of Ruby.  Benefit is very important for Ruby to be sustainable.</p><p>Benefit #1: Productivity. One of the reasons that Ruby is quite popular is that its productivity is quite high. An embodiment of this is Ruby on Rails. When Rails was released, it was often cited that people would say that Rails had 10x productivity over java.  Ruby developers didn’t really believe this, but a specific developer in the US wrote an article saying that he felt that <span
class="caps">HIS</span> productivity over Java when switching to Rails was 10x.  In 2005 and 2006, this one sentence caused a lot of arguments and discussion.</p><p>After several years of discussion and usage of Ruby on Rails, it may not be 10x but there are many cases where you can enjoy the productivity of Ruby on Rails over Java.</p><p>Also, another example of how Rails is productive is that it can take only 15 minutes to develop a web application. In 2004 at a Brazilian conference, David Heinemeier Hansson demonstrated web application development using Ruby on Rails. Without any preparation, no design, no database, he started to create a blog application. You could create articles, list them, etc. He created this application in 15 minutes. In 2004, creating an application in 15 minutes it was astonishing.  It was great marketing to do that.</p><p>I’m a software engineer and I’m not very interested in marketing. But that video was a huge contributor to making Ruby on Rails popular. Ruby itself didn’t have any marketing, but Ruby on Rails promoted Ruby as well.</p><p>Was the Rails framework the sole reason behind the productivity boost when using it? I don’t think so. Ruby itself also makes the productivity possible.</p><p>Post-Rails frameworks.<br
/> Merb<br
/> Sinatra<br
/> Ramaze<br
/> Rails 3</p><p>Merb was emerging as a post-Rails framework, but it was quite unique in open software. Merb and Rails jointly created a new framework in the form of Rails 3. Also, Rails 3 is inheriting some of the Merb characteristics. Totally new framework by combining/merging different frameworks.</p><p>So far I’ve been talking about the benefits that Ruby can provide in order to make Ruby sustainable.</p><p>The second element is the Potential the language can demonstrate. Now we have the technology and the technology is convenient and we can create some benefits. But we need to have potential in the Language for people to make investment.</p><p>Around Ruby we have much new technology. Ruby on Rails, for example, introduced innovations in Web development. It wasn’t the first web framework. Not even the first Web framework in Ruby. There were already a lot of web application frameworks in Ruby when Rails was released. But under the circumstances, Ruby on Rails implemented new ideas that triggered productivity enhancements in Ruby <span
class="caps">AND</span> other languages (python, etc.). So Ruby on Rails had a huge impact on the web application development arena.</p><p>Whenever a new technology is created, the surrounding areas also enjoy the benefits of this technology. Not all new technologies will be successful, but some of them will really boost the entire IT industry.</p><p>We do see some of that trend in the industry. To support the new technology we need to have smart engineers (hackers). The smart engineers usually come to the interesting technology. Whenever there’s new technology that’s created, it invites the smart engineers who then create new technology. This is a positive cycle. Ruby is one of these positive cycle enforcers.</p><p>Benefit, Potential, and….</p><p>Passion</p><p>The author of The Passionate Programmer, Chad Fowler, is here. I feel embarrassed to say something about him before his keynote. But I have to say this. He is right to emphasize passion. Many people are passionate about ruby. Engineer passion is very important.  Passion is key.</p><p>In the US there is a conference called RubyConf:http://rubyconf.org. The first one was held in Tampa Florida. There were only 34 attendees at the first conference. Right now we have more than 500 people attending. If the venue could handle it we could probably fit 700 or 1000. They actually limit the number of attendees. They sell out every year. This year RubyConf will be held in <a
href="http://www.city.matsue.shimane.jp/kankou/en/">Matsue’s</a> sister city, New Orleans. It will be the 10th. It is the longest running Ruby conference on the globe.</p><p>Euruko. Poland, Barcelona, Berlin, Prague.  On the last day, Euruko always invites speakers to bid on where Euruko should be. Speakers make their case and the location of the next Euruko is voted on.</p><p>Two weeks ago we had RubyKaigi.  It was held in Tsukuba City. Not in Tokyo. I graduated from Tsukuba univeristy. It made me feel like i was going home. We had about 700 people at RubyKaigi this year. RubyConf will have 500 (ed: actually 600 to 650). The biggest conference is held in Japan.</p><p>As you can see here in this venue as well Ruby World has so many people from so many countries. I would say that the IT industry is japan is becoming truly internationalized. We have a disadvantage in Matsue because it’s so remote, but the passion of the Rubyists makes it possible.</p><p>We also have regional Ruby conferences in India, China, Brazil, all over the US, etc. They also have another conference called RailsConf:http://railsconf.org, which is operated by a professional event management company (ed: and <a
href="http://rubycentral.org">Ruby Central</a>). They had 1800 people. So that really boosts Ruby.</p><p>Startup passion.  I’m going to talk about US companies, but there are many venture companies in Silicon valley who are very interested in Ruby. More than 60% of VCs use Ruby to provide the system.  Among the famous ones known to Japan includes Twitter. As a startup, they implemented everything using Ruby from bottom to top. Currently they have 100s of millions of users. Much of the RUby has been replaced but if you access twitter you can still see twitter driving the system.</p><p>As of last year another acronym was introduced “ARC”. Agile, Ruby/Rails, Cloud.  I’ve heard that VCs ask startups who aren’t using Ruby, “Why not?” Investors are pressuring startups to use Ruby. “It’s faster, so if you can shorten your release by one month why not use Ruby?”, they say.</p><p>A few years ago when startups were getting started, they wanted to attract smart engineers, so they used Ruby to attract them.</p><p>Executives’ passion: Productivity is the key.  It’s not just the engineers who are passionate about Ruby. Productivity is one of the biggest factors for businesses. Executives started to realize the importance of using a productive language. Productive languages drive profit.  Some executives are finding hope in Ruby.</p><p>Differentiation can be found by using Ruby. The japanese IT industry is characterized by conservatism, so many may be reluctant to use Ruby. But by making the decision to use Ruby, they may differentiate themselves. There is also the possibility to change the entire industrial structure by switching to Ruby and other open source technologies, driving more SMBs.</p><p>In Japan, major IT companies receive contracts and subcontract to others. But with Ruby and smart engineers, these can be driven to small businesses which can innovate. This drives hope.</p><p>Motivation drives Hope</p><p>for Food<br
/> for Money<br
/> These are very pragmatic</p><p>for Good Cause<br
/> But some people might make a bigger attempt to change the world.</p><p>Many people are finding hope in Ruby. Many found potential in Ruby.</p><p>Not all have succeeded.  Some are extremely successful. Some are not.  What made the difference?</p><p>In some cases, the benefit was not enough. Or people couldn’t see the potential. But the biggest factor was <span
class="caps">PASSION</span>!  How passionate or decisive they were made the difference.</p><p>Lots of people love Ruby. Pictured here (ed: he shows a picture in his slide) are the smiling faces of the staff of the RubyKaigi. This is not organized by professionals. 700 turnout is already beyond its technical limits. But when we ran the survey, most people were satisfied by the conference. It’s miraculous considering the tough circumstances. But these people are passionate.</p><p>Many people are surrounding ruby. Hacker,s engineers, executives.  They <span
class="caps">LOVE</span> Ruby.</p><p>Of course I love Ruby myself. It’s my child. Every day I am expanding my affection for Ruby. There are so many people out there that love Ruby. As a Japanese, I’m reluctant to say “love”. Actually one guy said “I love you”. I am poor at English. I was very embarrassed <img
src='http://seriouslyruby.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> For Japanese, it’s difficult to express love in a direct fashion. Of course that guy didn’t mean “love”. He just loved Ruby. Like a strong kinship.</p><p>Many people love Ruby. Let me give you some examples:</p><p>NaCl. When i started at NaCl, Inoue-san he actually picked me up and allowed me to work on this. Back in 1995, there was no way to know if Ruby would be used by anyone. But the president, Mr. Inoue-san had the faith and the vision to hire me and let me work on Ruby. He gave me plenty of time to work on Ruby. It’s all possible because of him.</p><p>In 2006, the Matsue mayor actually visited our lab. We would like to use Ruby to revive the city. I had to reply, “Are you out of your mind?” Can you believe this person would try to revive our city using Ruby? Many people living in many places outside of Matsue, so I said maybe it’s difficult but someone from the city told me the Mayor was very serious about this. The mayor himself actually expressed his desire to use Ruby. So as a local government, Matsue city is committed to promote Ruby, which is very very exceptional on examination.  How much contribution we’re making to the city really is unknown.</p><p>This is Mr. Mizoguchi the Shimane governor. I don’t know how to show my appreciation to him. I’d like to take this opportunity to thank him again. There are many other local governments who are interested in using Ruby to revive their city. But the question is how passionate are the top management or the governor or mayor? Even if the promoters work hard, unless top management is passionate about the promotion it’s not going to work.</p><p>One exceptional case is the governor of <a
href="http://en.wikipedia.org/wiki/Fukuoka">Fukuoka</a>.  A rival of Shimane <img
src='http://seriouslyruby.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . For some reason he really loves Ruby. I’m living her and he’s in Fukuoka. There’s no relation. But Fukuoka is committed to using Ruby and they have organized the Fukuoka award and they have the <a
href="http://rubybizcommons.jp/en/">Ruby Business Commons</a> headquarters.</p><p>Here is a noodle called Ruby on Matsue Ramen. The maker of this Ramen sent me an email. The maker of this has no connection to Ruby, but he has a local businesses and wants to promote Ruby. He offered to include the Ruby logo on this noodle to contribute to sales. It’s remarkable. This person volunteered to make Ruby Ramen for us without us asking.</p><p>And thanks to all the efforts of all these people, Ruby is exciting right now.</p><p>I have been engaged in Ruby for 17 years and i think it’s making sense for me to be passionate about Ruby. But many others are passionate about Ruby. I don’t understand why, but Ruby is loved. Love is driving Ruby.</p><p>With the support of so many people, we are able to hold this Ruby World conference for the next two days. And I hope that for these days we can fully discuss the benefits of Ruby so that it will be helpful to what you do. 17 years ago I was the only one person who used Ruby. But over 17 years, people who are using Ruby  (more than 1,000,000 people) in university Research, implemented in IT industry, etc.</p><p>Some of the things Ruby users are discussing are quite inspiring. Without this conference we can’t attract all of these great people to Matsue people. We should take advantage of this opportunity.</p><p>Ruby is supported by passion. And by love.</p><p>One more thing: The Ruby Association which I chair provides Ruby programmer certification. We have this announcement today that we have created a new “Gold” certification for Ruby programmers. This requires a higher level of skill. If you go to the <a
href="http://www.ruby-assn.org/en/">Ruby Association home page</a>, there is a press announcement which explains what you need to do to be qualified as Ruby “Gold” certified.</p><p>Thank you.</p> ]]></content:encoded> <wfw:commentRss>http://seriouslyruby.com/2010/09/05/22/20/00/matz-ruby-world-keynote/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>New Course: Ruby Programming 101</title><link>http://rubylearning.com/blog/2010/09/06/new-course-ruby-programming-101/</link> <comments>http://rubylearning.com/blog/2010/09/06/new-course-ruby-programming-101/#comments</comments> <pubDate>Mon, 06 Sep 2010 03:16:48 +0000</pubDate> <dc:creator>Satish Talim</dc:creator> <category><![CDATA[Publishers]]></category> <category><![CDATA[Ruby Learning Blog]]></category> <category><![CDATA[Beginners]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[ruby]]></category> <category><![CDATA[Ruby course]]></category> <category><![CDATA[Ruby training]]></category> <category><![CDATA[Training]]></category><guid
isPermaLink="false">http://rubylearning.com/blog/?p=4423</guid> <description><![CDATA[Introducing an intensive, online course for beginners that helps you get started with Ruby programming. What&#8217;s Ruby? According to http://www.ruby-lang.org/en/ &#8211; &#8220;Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.&#8221; Yukihiro Matsumoto, the creator of [...]]]></description> <content:encoded><![CDATA[</p><div><p><span
class="drop_cap">I</span>ntroducing an intensive, online course for <em>beginners</em> that helps you get started with <strong>Ruby</strong> programming.</p><h3>What&#8217;s Ruby?</h3><p><img
class="alignright" title="License: http://creativecommons.org/licenses/by-sa/2.5/" src="http://rubylearning.com/images/rubylogo.png" alt="Ruby" height="125" width="125" /></p><p>According to <a
href="http://www.ruby-lang.org/en/">http://www.ruby-lang.org/en/</a> &#8211; &#8220;Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.&#8221;</p><p><b>Yukihiro Matsumoto</b>, the creator of Ruby, in <b><a
href="http://linuxdevcenter.com/pub/a/linux/2001/11/29/ruby.html">an interview</a></b> says &#8211; &#8220;I believe people want to express themselves when they program. They don&#8217;t want to fight with the language. Programming languages must feel natural to programmers. I tried to make people enjoy programming and concentrate on the fun and creative part of programming when they use Ruby.&#8221;</p><h3>What Will I Learn?</h3><p>In the Ruby programming 101 course, you will learn the <a
href="http://rubylearning.com/satishtalim/tutorial.html">essential features of Ruby</a> that you will end up using every day.</p><h3>Who&#8217;s It For?</h3><p><b>An <em>absolute beginner</em> but with some experience in some other programming language</b>.</p><h3>Mentors</h3><p><a
href="http://satishtalim.com/">Satish Talim</a>, Satoshi Asakawa, Victor Goff III and others from the RubyLearning team.</p><h3>Dates</h3><p>The course starts on Saturday, 23rd Oct. 2010 and runs for two months.</p><h3>Course Fees</h3><h4>Early Bird Registration Discounts</h4><ul><li>For the first 30 registrations, Course Fee: US$ 9.95 per participant.</li><li>After the first 30 registrations, Course Fee US$ 14.95 per participant.</li></ul><p>Hurry, registrations have started.</p><p
class="alert">At the end of this course you should have all the knowledge to explore the wonderful world of Ruby on your own.</p><h3>How do I register?</h3><p>You first need to <a
href="http://rubylearning.org/">register on the site</a> and then <a
href="http://rubylearning.org/class/course/view.php?id=61">enroll into the course</a>.</p><p><img
src='http://rubylearning.com/images/update.jpg' style="border: 0px none ;" alt="Update" title="Update" /></p><p><b>6th Sept.</b> &#8211; So far the registered participants are from:</p><ul><li>Phnom Penh, Cambodia</li><li>Paris, France</li><li>Puerto Rico</li><li>Ljubljana, Slovenia</li><li>Yalova, Turkey</li><li>Crystal, USA</li><li>Los Angeles, USA</li></ul><p>Also, many of you wrote in asking for details on how the course works. Here are some of the details:</p><h4>Important:</h4><p>Once the course starts, you can login and start with the lessons <b>any day and time</b> and post your queries in the forum under the relevant lessons. Someone shall always be there to answer them. Just to set the expectations correctly, there is no real-time &#8216;webcasting&#8217;.</p><h4>Methodology:</h4><ul><li>The Mentors shall give you URL&#8217;s of pages and sometimes some additional notes; you need to read through. Read the pre-class reading material at a convenient time of your choice &#8211; the dates may be specified only as a guideline. While reading, please make a note of all your doubts, queries, questions, clarifications, comments about the lesson and after you have completed all the pages, post these on the forum <b>under the relevant lesson</b>. There may be some questions that relate to something that has not been mentioned or discussed by the mentors thus far; you could post the same too. Please remember that with every post, do mention the operating system of your computer.</li><li>The mentor shall highlight the important points that you need to remember for that day&#8217;s session.</li><li>There could be exercises every day. Please do them.</li><li>Participate in the forum for asking and answering questions or starting discussions. Share knowledge, and exchange ideas amongst yourselves during the course period. Participants are strongly encouraged to post technical questions, interesting articles, tools, sample programs or anything that is relevant to the class / lesson. Please do not post a simple &quot;Thank you&quot; note or &quot;Hello&quot; message to the forum. This forum is subscribed by several people, so please be aware that these messages are considered as noises by many people.</li></ul><h4>Outline of Work Expectations:</h4><ol><li>Most of the days, you will have exercises to solve. These are there to help you assimilate whatever you have learned till then.</li><li>Some days may have some additional assignments / food for thought articles / programs</li><li><strong>Above all, do participate in the relevant forums. Past participants will confirm that they learned the best by active participation.</strong></li></ol><h4>Some Commonly Asked Questions</h4><ul><li><b>Qs.</b> Is there any specific time when I need to be online?<br
/><b>Ans.</b> No. You need not be online at a specific time of the day.</li><li><b>Qs.</b> Is it important for me to participate in the course forums?<br
/><b>Ans.</b> YES. You must Participate in the forum(s) for asking and answering questions or starting discussions. Share knowledge, and exchange ideas amongst yourselves (participants) during the course period. Participants are strongly encouraged to post technical questions, interesting articles, tools, sample programs or anything that is relevant to the class / lesson. Past participants will confirm that they learned the best by active participation.</li><li><b>Qs.</b> How much time do I need to spend online for a course, in a day?<br
/><b>Ans.</b> This will vary from person to person. All depends upon your comfort level and the amount of time you want to spend on a particular lesson or task.</li><li><b>Qs.</b> Is there any specific set time for feedback (e.g., any mentor responds to me within 24 hours?)<br
/><b>Ans.</b> Normally somebody should answer your query / question within 24 hours.</li><li><b>Qs.</b> What happens if nobody answers my questions / queries?<br
/><b>Ans.</b> Normally, that will not happen. In case you feel that your question / query is not answered, then please post the same in the thread &#8211; &#8220;Any UnAnswered Questions / Queries&#8221;.</li><li><b>Qs.</b> What happens to the class (or forums) after a course is over? Can you keep it open for a few more days so that students can complete and discuss too?<br
/><b>Ans.</b> The course and its forum is open for a month after the last day of the course.</li></ul><p>Remember, the idea is to have fun learning Ruby.</p></div><p>Technorati Tags: <a
href="http://technorati.com/tag/Ruby+course" rel="tag">Ruby course</a>, <a
href="http://technorati.com/tag/Ruby" rel="tag">Ruby</a>, <a
href="http://technorati.com/tag/Ruby+Training" rel="tag">Ruby Training</a>, <a
href="http://technorati.com/tag/Programming" rel="tag"> Programming</a></p><div
class="feedflare"> <a
href="http://feeds.feedburner.com/~ff/LearningRubyBlog?a=i9_sozZZL7k:Qjfx2eEEei0:yIl2AUoC8zA"><img
src="http://feeds.feedburner.com/~ff/LearningRubyBlog?d=yIl2AUoC8zA" border="0"></img></a> <a
href="http://feeds.feedburner.com/~ff/LearningRubyBlog?a=i9_sozZZL7k:Qjfx2eEEei0:MclgosYkiZA"><img
src="http://feeds.feedburner.com/~ff/LearningRubyBlog?i=i9_sozZZL7k:Qjfx2eEEei0:MclgosYkiZA" border="0"></img></a></div> ]]></content:encoded> <wfw:commentRss>http://rubylearning.com/blog/2010/09/06/new-course-ruby-programming-101/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Ruby on Rails 2.3.9 Released</title><link>http://feedproxy.google.com/~r/RidingRails/~3/Gw07WrgH8fk/ruby-on-rails-2-3-9-released</link> <comments>http://feedproxy.google.com/~r/RidingRails/~3/Gw07WrgH8fk/ruby-on-rails-2-3-9-released#comments</comments> <pubDate>Sat, 04 Sep 2010 21:45:00 +0000</pubDate> <dc:creator>Jeremy Kemper</dc:creator> <category><![CDATA[Publishers]]></category><guid
isPermaLink="false"></guid> <description><![CDATA[
We’ve released Ruby on Rails 2.3.9 (gem and git tag) to extend the 2.3.8 bridge a few steps closer to Rails 3 and Ruby 1.9. If your app runs on Rails 2.3.9 without deprecation warnings, you’re looking good for an upgrade to Rails 3....]]></description> <content:encoded><![CDATA[<p>We’ve released Ruby on Rails 2.3.9 (<a
href="http://rubygems.org/gems/rails/versions/2.3.9">gem</a> and <a
href="http://github.com/rails/rails/tree/v2.3.9">git tag</a>) to extend the 2.3.8 bridge a few steps closer to Rails 3 and Ruby 1.9. If your app runs on Rails 2.3.9 without deprecation warnings, you’re looking good for an upgrade to Rails 3.</p><h4>Deprecations</h4><ul><li>Changes i18n named-interpolation syntax from the deprecated <code>Hello {{name}}</code> to the 1.9-native <code>Hello %{name}</code>.</li><li>Replaces <code>Kernel#returning</code> with <code>Object#tap</code> which is native to Ruby 1.8.7.</li><li>Renames <code>Array#random_element</code> to <code>Array#sample</code> which is native to Ruby 1.9.</li><li>Renames <code>config.load_paths</code> and <code>.load_once_paths</code> to the more accurate <code>config.autoload_paths</code> and <code>.autoload_once_paths</code>.</li></ul><p>Along with these deprecations come a broad array of bugfixes and minor tweaks. Read the <a
href="http://github.com/rails/rails/compare/v2.3.8...v2.3.9">commit log</a> for the full story.</p><p>Onward to 3.1!</p> ]]></content:encoded> <wfw:commentRss>http://seriouslyruby.com/2010/09/04/14/45/00/ruby-on-rails-2-3-9-released/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Sep 3, 2010: Twitter for iPad and Other Craziness</title><link>http://feedproxy.google.com/~r/railsprescriptions/~3/rYLA0yNTbHU/</link> <comments>http://feedproxy.google.com/~r/railsprescriptions/~3/rYLA0yNTbHU/#comments</comments> <pubDate>Fri, 03 Sep 2010 12:05:20 +0000</pubDate> <dc:creator>noelrap</dc:creator> <category><![CDATA[Publishers]]></category> <category><![CDATA[Rails Prescriptions]]></category> <category><![CDATA[iPad]]></category> <category><![CDATA[twitter]]></category><guid
isPermaLink="false">https://railsrx.wordpress.com/?p=239</guid> <description><![CDATA[Book Status RSpec chapter edits complete, a dozen or so errata squashed, and hopefully we&#8217;ll get beta 7 out. I suspect it&#8217;ll be after Labor Day, though. I&#8217;m pleased with how this one turned out. The RSpec chapter is a challenge &#8212; I&#8217;m literally squeezing a book&#8217;s worth of content into a chapter, but I [...]<img
alt="" border="0" src="http://stats.wordpress.com/b.gif?host=railsrx.com&#38;blog=10160445&#38;post=239&#38;subd=railsrx&#38;ref=&#38;feed=1" width="1" height="1" />]]></description> <content:encoded><![CDATA[<h3>Book Status</h3><p>RSpec chapter edits complete, a dozen or so errata squashed, and hopefully we&#8217;ll get beta 7 out. I suspect it&#8217;ll be after Labor Day, though. I&#8217;m pleased with how this one turned out. The RSpec chapter is a challenge &#8212; I&#8217;m literally squeezing a book&#8217;s worth of content into a chapter, but I think it covers the major points clearly.</p><p>Since I haven&#8217;t posted it in a while, you can buy the book <a
href="http://www.pragprog.com/titles/nrtest/rails-test-prescriptions">here</a> and on <a
href="http://www.amazon.com/gp/product/1934356646?ie=UTF8&amp;tag=10prinhell-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1934356646">Amazon</a>.</p><p>That, I think, pretty much ends the content that had some basis in the Lulu book, moving us into the one or two chapters that I need to write from scratch, as well as at least one chapter that has been obsoleted over the summer (BlueRidge). Still, getting closer.</p><h3>WindyCityRails Update</h3><p>Still seats available for my <a
href="http://www.windycityrails.com">WindyCityRails</a> tutorial. Right now, I&#8217;m trying to coordinate what I want to say with the faux-legacy app I&#8217;m building for people to practice on. The faux app needs to look legacy-ish, but still be easy enough to install and work with that something meaningful can be done in a three hour tutorial. Interesting problem.</p><h3>More iPad</h3><p>Two possible changes in my iPad app mix:</p><h4>Twitter app replacing Osfoora HD</h4><p>For all that it&#8217;s kind of insane, I really like the official Twitter iPad app. It&#8217;s super polished, and although I&#8217;m not convinced that the actual implementation of the overlapping tabs is optimal, I think the basic idea is great. One interesting point is that they clearly have chosen to favor a specific kind of Twitter user.</p><p>The overlapping tab works well at letting you see data related to a tweet (usually the contents of a link) and still see your account side bar and some of your timeline. It&#8217;s quite pretty, aggressively bold in the way the original Tweetie app was, and useful. I appreciate that it&#8217;s fewer clicks and generally easier to follow links on a lot of tweets in short succession, which I do a lot. I do think it&#8217;s weird that the browser tab kind of half-sticks around even after you go back to your timeline, and it&#8217;s easy to miss the spots where the browser tab slides back (as opposed to trying to horizontal scroll the browser window). A lot of people are reporting that it&#8217;s hard to figure out how to move the panes &#8212; I think it could be clearer in-app.</p><p>But, I like that it keeps my place when I change orientation &#8212; which is Osfoora&#8217;s most annoying non-feature. I like the layout in general, I think it gets the natural proportion of a twitter stream right (a lot of the other Twitter apps make the stream really wide, which feels strange to me), and it feels very polished and responsive.</p><p>Now I wish that the Mac Tweetie that I bought MacHeist in order to get an early beta might actually come out. Sigh.</p><h4>River of News replacing Reeder, Maybe.</h4><p>I&#8217;m not sure about this one. River of News is a simple RSS reader that displays articles in a basic River of News style, meaning one after another.</p><p>It&#8217;s not as pretty or full featured as Reeder, but it&#8217;s also less inscrutable and I tend to like the general layout.</p><p>Right now it seems as though River of News works better when I&#8217;m reading most of the articles in a feed or folder, because it scrolls better than Reeder does. But since Reeder has the mini previews, it&#8217;s faster if I plan on skipping most of a feed. Still wondering which will work best.</p><p>Filed under: <a
href='http://railsrx.com/category/ipad/'>iPad</a>, <a
href='http://railsrx.com/category/twitter/'>Twitter</a> <a
rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/railsrx.wordpress.com/239/"><img
alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/railsrx.wordpress.com/239/" /></a> <a
rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/railsrx.wordpress.com/239/"><img
alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/railsrx.wordpress.com/239/" /></a> <a
rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/railsrx.wordpress.com/239/"><img
alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/railsrx.wordpress.com/239/" /></a> <a
rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/railsrx.wordpress.com/239/"><img
alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/railsrx.wordpress.com/239/" /></a> <a
rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/railsrx.wordpress.com/239/"><img
alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/railsrx.wordpress.com/239/" /></a> <a
rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/railsrx.wordpress.com/239/"><img
alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/railsrx.wordpress.com/239/" /></a> <a
rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/railsrx.wordpress.com/239/"><img
alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/railsrx.wordpress.com/239/" /></a> <img
alt="" border="0" src="http://stats.wordpress.com/b.gif?host=railsrx.com&amp;blog=10160445&amp;post=239&amp;subd=railsrx&amp;ref=&amp;feed=1" width="1" height="1" /><div
class="feedflare"> <a
href="http://feeds.feedburner.com/~ff/railsprescriptions?a=rYLA0yNTbHU:zyZikPhtGiw:yIl2AUoC8zA"><img
src="http://feeds.feedburner.com/~ff/railsprescriptions?d=yIl2AUoC8zA" border="0"></img></a> <a
href="http://feeds.feedburner.com/~ff/railsprescriptions?a=rYLA0yNTbHU:zyZikPhtGiw:V_sGLiPBpWU"><img
src="http://feeds.feedburner.com/~ff/railsprescriptions?i=rYLA0yNTbHU:zyZikPhtGiw:V_sGLiPBpWU" border="0"></img></a> <a
href="http://feeds.feedburner.com/~ff/railsprescriptions?a=rYLA0yNTbHU:zyZikPhtGiw:F7zBnMyn0Lo"><img
src="http://feeds.feedburner.com/~ff/railsprescriptions?i=rYLA0yNTbHU:zyZikPhtGiw:F7zBnMyn0Lo" border="0"></img></a></div><p><img
src="http://feeds.feedburner.com/~r/railsprescriptions/~4/rYLA0yNTbHU" height="1" width="1"/></p> ]]></content:encoded> <wfw:commentRss>http://railsrx.com/2010/09/03/sep-3-2010-twitter-of-ipad-and-other-craziness/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <enclosure
url="http://0.gravatar.com/avatar/6b767d8a4c9910e007c122d81eb4de73?s=96&amp;amp;d=&amp;amp;r=G" length="" type="" /> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached
Database Caching 4/43 queries in 0.048 seconds using memcached

Served from: seriouslyruby.com @ 2010-09-09 11:44:01 -->