<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>tag:blog.gregspurrier.com:/articles</id>
  <title>Greg's Blog</title>
  <subtitle>Thoughts on Ruby, Rails, and Software Development</subtitle>
  <updated>2012-04-10T04:33:52Z</updated>
  <link href="http://blog.gregspurrier.com/"/>
  <author>
    <name>Greg Spurrier</name>
  </author>
  <entry>
    <title>Moving to Source Matters</title>
    <id>tag:blog.gregspurrier.com,2012-04-10:/articles/moving-to-source-matters</id>
    <updated>2012-04-10T04:35:57Z</updated>
    <published>2012-04-10T04:33:52Z</published>
    <link href="http://blog.gregspurrier.com/articles/moving-to-source-matters"/>
    <author>
      <name>Greg Spurrier</name>
    </author>
    <content type="html">&lt;p&gt;I've started a new blog called &lt;a href="http://sourcematters.org"&gt;Source Matters&lt;/a&gt;. I've moved the one post that I had here from 2012--&lt;a href="http://sourcematters.org/2012/03/12/in-my-toolkit-midje.html"&gt;In My Toolkit: Midje&lt;/a&gt;--but have not yet decided whether to migrate the older posts. In the mean time, they will remain available here.&lt;/p&gt;

&lt;p&gt;Thank you for reading this blog and I hope to see you at &lt;a href="http://sourcematters.org"&gt;Source Matters&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Relative Performance of Symbol#to_proc in Popular Ruby Implementations</title>
    <id>tag:blog.gregspurrier.com,2010-11-16:/articles/relative-performance-of-symbol-to-proc-in-popular-ruby-implementations</id>
    <updated>2010-11-16T16:34:33Z</updated>
    <published>2010-11-16T16:34:33Z</published>
    <link href="http://blog.gregspurrier.com/articles/relative-performance-of-symbol-to-proc-in-popular-ruby-implementations"/>
    <author>
      <name>Greg Spurrier</name>
    </author>
    <content type="html">&lt;p&gt;When Rails 1.1 introduced &lt;code&gt;Symbol#to_proc&lt;/code&gt; in 2006, many people, including me, embraced the convenience and elegance of being able to write code such as this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;post_ids = posts.map &amp;amp;:id
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;instead of the equivalent standard Ruby syntax:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;post_ids = posts.map {|post| post.id}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Others pointed out that the &lt;code&gt;Symbol#to_proc&lt;/code&gt; approach was much slower than using an explicit block. A commenter on &lt;a href="http://blog.hasmanythrough.com/2006/3/7/symbol-to-proc-shorthand#comments" title="Comments on 'Symbol to Proc shorthand'"&gt;this post&lt;/a&gt; on Josh Susser's blog, for example, shows a benchmark revealing &lt;code&gt;Symbol#to_proc&lt;/code&gt; to be 3.4 times slower on one example.&lt;/p&gt;

&lt;p&gt;In the intervening years, &lt;code&gt;Symbol#to_proc&lt;/code&gt; has become part of standard distribution of Ruby 1.8.7 and Ruby 1.9. Being curious about its performance on current Ruby implementations, I constructed a simple benchmark and ran it on the Rubies that I have installed under RVM. My version of the benchmark measures performance of &lt;code&gt;Symbol#to_proc&lt;/code&gt; when used with &lt;code&gt;map&lt;/code&gt; on arrays of a variety of lengths.&lt;/p&gt;

&lt;p&gt;The benchmark code and raw result data can be found &lt;a href="https://gist.github.com/701990" title="Benchmark Implementation and Results from MacBook Pro"&gt;here&lt;/a&gt;. The table below summarizes the results. Each cell shows the number of times slower that &lt;code&gt;Symbol#to_proc&lt;/code&gt; is in comparison to using a block.&lt;/p&gt;

&lt;table&gt;
&lt;tr&gt;&lt;th&gt;&amp;nbsp;&lt;/th&gt;&lt;th&gt;10 Elements&lt;/th&gt;&lt;th&gt;100 Elements&lt;/th&gt;&lt;th&gt;1,000 Elements&lt;/th&gt;&lt;/tr
&lt;tr&gt;&lt;td&gt;Ruby 1.8.7&lt;/td&gt;&lt;td&gt;2.24&lt;/td&gt;&lt;td&gt;1.56&lt;/td&gt;&lt;td&gt;1.34&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;REE 1.8.7&lt;/td&gt;&lt;td&gt;2.49&lt;/td&gt;&lt;td&gt;1.93&lt;/td&gt;&lt;td&gt;1.66&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Ruby 1.9.2&lt;/td&gt;&lt;td&gt;1.03&lt;/td&gt;&lt;td&gt;0.94&lt;/td&gt;&lt;td&gt;0.95&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;JRuby 1.5.3&lt;/td&gt;&lt;td&gt;7.22&lt;/td&gt;&lt;td&gt;3.18&lt;/td&gt;&lt;td&gt;3.61&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Rubinius 1.1.0&lt;/td&gt;&lt;td&gt;5.82&lt;/td&gt;&lt;td&gt;7.55&lt;/td&gt;&lt;td&gt;6.86&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;MacRuby 0.7.1&lt;/td&gt;&lt;td&gt;6.86&lt;/td&gt;&lt;td&gt;9.80&lt;/td&gt;&lt;td&gt;9.96&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;


&lt;p&gt;In Ruby 1.9.2, the performance of the two forms is very close. In fact, &lt;code&gt;Symbol#to_proc&lt;/code&gt; is actually faster for longer arrays.&lt;/p&gt;

&lt;p&gt;What I found most interesting, though, was how much larger the performance penalty for using &lt;code&gt;Symbol#to_proc&lt;/code&gt; is in JRuby, Rubinius, and MacRuby. I will keep that in the back of my mind when I'm writing code that may be used in those environments.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Release Announcement: has_enumeration 1.0.0</title>
    <id>tag:blog.gregspurrier.com,2010-11-08:/articles/release-announcement-has-enumeration-1-0-0</id>
    <updated>2010-11-08T15:24:46Z</updated>
    <published>2010-11-08T15:24:46Z</published>
    <link href="http://blog.gregspurrier.com/articles/release-announcement-has-enumeration-1-0-0"/>
    <author>
      <name>Greg Spurrier</name>
    </author>
    <content type="html">&lt;p&gt;This month marks five years since I left a career in embedded systems software development in a quest to reignite my passion for programming. I began my love affair with Ruby shortly thereafter. It was elegant and expressive. It was object-oriented and had closures. It was everything that I had been yearning for while programming in C for all those years.&lt;/p&gt;

&lt;p&gt;There are times, though, when I have flashbacks to my C days. Consider this code snippet:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class Car &amp;lt; ActiveRecord::Base
  # Values of the color attribute
  RED = 1
  GREEN = 2
  BLUE = 3
end

car = Car.new(:color =&amp;gt; Car::RED)
# ...
if car.color == Car::RED
  # ...
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This reminds me of C-style &lt;code&gt;#define&lt;/code&gt; constants and feels clunky. A popular variation is to use a &lt;code&gt;Car::COLOR&lt;/code&gt; hash keyed by symbols representing the color names. The downside is that comparisons with the color values become even more verbose (e.g., &lt;code&gt;Car::COLOR[:red]&lt;/code&gt;) and a typo in the color name is no longer caught as an unknown constant, leading to potentially hard to find bugs.&lt;/p&gt;

&lt;p&gt;A different approach is to store the enumerated value as a string rather than an integer. Now the code looks nicer (&lt;code&gt;if car.color == 'red'&lt;/code&gt;) and the database performance is nearly identical if you use an enum column to represent the attribute. But, there is still the possibility of bugs from misspelled values.&lt;/p&gt;

&lt;h2&gt;Enter has_enumeration&lt;/h2&gt;

&lt;p&gt;Using the approaches described above to handle what is essentially an enumerated type stored in an ActiveRecord attribute has always struck me as lacking. Eventually I set out to approach the problem in more idiomatic Ruby way. The result is my &lt;a href="http://rubygems.org/gems/has_enumeration" title="has_enumeration gem page on RubyGems.org"&gt;&lt;code&gt;has_enumeration&lt;/code&gt; gem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is the car example again, using has_enumeration:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class Car &amp;lt; ActiveRecord::Base
  has_enumeration :color, :red =&amp;gt; 1, :green =&amp;gt; 2, :blue =&amp;gt; 3
end

car = Car.new(:color =&amp;gt; :red)
# ...
if car.color.red?
  # ...
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The values of the enumeration are represented by symbols regardless of the underlying representation in the database. Predicates are provided for testing whether the enumerated attribute has a given value. The symbolic values work with query methods as well:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# Rails 2.x
Car.find(:all, :conditions =&amp;gt; {:color =&amp;gt; :red})

# Rails 3
Car.where(:color =&amp;gt; :red)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When using Rails 3, &lt;code&gt;has_enumeration&lt;/code&gt; plugs in at the Arel attribute level. This allows it to work seamlessly with code that directly manipulates Arel attributes and with plugins like meta_where that extend Arel's functionality.&lt;/p&gt;

&lt;p&gt;To help catch coding errors, &lt;code&gt;has_enumeration&lt;/code&gt; will raise an &lt;code&gt;ArgumentError&lt;/code&gt; if you attempt to assign or query for a symbol that is not part of the attribute's set of values.&lt;/p&gt;

&lt;h2&gt;Getting More Information&lt;/h2&gt;

&lt;p&gt;You can find the source code and more examples of its use on the &lt;a href="http://github.com/gregspurrier/has_enumeration" title="has_enumeration project page on github"&gt;&lt;code&gt;has_enumeration&lt;/code&gt; github project page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope that you find this gem useful. Please let me know if you encounter any problems or if there is any additional functionality that would make it work better for you.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Arbitrary Reordering of Ruby Arrays</title>
    <id>tag:blog.gregspurrier.com,2010-11-07:/articles/arbitrary-reordering-of-ruby-arrays</id>
    <updated>2010-11-07T21:06:50Z</updated>
    <published>2010-11-07T21:06:50Z</published>
    <link href="http://blog.gregspurrier.com/articles/arbitrary-reordering-of-ruby-arrays"/>
    <author>
      <name>Greg Spurrier</name>
    </author>
    <content type="html">&lt;p&gt;Reordering an array in Ruby is easily accomplished with &lt;code&gt;Array#sort&lt;/code&gt; as long as you can provide a block that can compare two elements of the array and indicate their relative ordering. But, what if determining the relative ordering of the elements is not as simple as using the equivalent of the &lt;code&gt;&amp;lt;=&amp;gt;&lt;/code&gt; operator on the two elements? What if, say, you wanted to reorder an array of ActiveRecord objects to reflect the order in which their IDs were returned by your search engine?&lt;/p&gt;

&lt;p&gt;For that, something like this would do the trick:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ranked_ids = Book.search_by_title('ruby')
books = Book.where(:id =&amp;gt; ranked_ids).reorder_by(ranked_ids, &amp;amp;:id)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This assumes that &lt;code&gt;Book.search_by_title&lt;/code&gt; returns an array of IDs that are ordered by their relevance to the search term. The corresponding objects are fetched from the database and then reordered to match the order returned by the search call.&lt;/p&gt;

&lt;p&gt;Of course, &lt;code&gt;reorder_by&lt;/code&gt; is not part of the standard Ruby library. We get to build it ourselves. Here is a first attempt:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;module Enumerable
  def reorder_by1(order, &amp;amp;key_proc)
    order.map do |x|
      find {|obj| key_proc.call(obj) == x}
    end
  end
end

# Make sure it works...
describe Enumerable, "#reorder_by1" do
  before(:each) do
    @objects = [:a, :b, :c, :d, :e]
    @ordering = %w(e b c d a)
    @expected = [:e, :b, :c, :d, :a]
  end

  it 'reorders the objects in the desired order' do
    @objects.reorder_by1(@ordering, &amp;amp;:to_s).should == @expected
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;code&gt;reorder_by1&lt;/code&gt; iterates through each key in the desired ordering and finds the first object for which &lt;code&gt;key_proc&lt;/code&gt; returns that key. The spec passes, but benchmarking results show that it is very slow: with a 52-object array, 10,000 reorderings took 7.2 seconds.  We can do better.&lt;/p&gt;

&lt;p&gt;Let's start with computing the result of &lt;code&gt;key_proc&lt;/code&gt; just once per element of the array:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;module Enumerable
  def reorder_by2(order, &amp;amp;key_proc)
    indexed = map {|x| [key_proc.call(x), x]}
    order.map do |x|
      indexed.find {|pair| pair.first == x}.last
    end
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This version first makes (key, object) pairs and then searches those pairs for matching objects. This improves things significantly: the same benchmark now completes in 3.2 seconds. We are still using an O(n&lt;sup&gt;2)&lt;/sup&gt; algorithm, though. We can do better.&lt;/p&gt;

&lt;p&gt;Here is the final version of &lt;code&gt;reorder_by&lt;/code&gt; that looks up the corresponding objects in a hash rather than using a linear search:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;module Enumerable
  def reorder_by(order, &amp;amp;key_proc)
    index_to_obj = inject({}) do |hash, obj|
      hash[key_proc.call(obj)] = obj
      hash
    end
    order.map do |x|
      index_to_obj[x]
    end
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This version clocks in at 0.7 seconds: a 10x improvement over the first version. I am satisfied with that result and no other optimizations come to mind. I would not be surprised, though, if it could be made at least a little faster.&lt;/p&gt;

&lt;p&gt;I've posted the above code along with the benchmark setup to &lt;a href="https://gist.github.com/666787"&gt;this gist&lt;/a&gt;. If you have ideas for making &lt;code&gt;reorder_by&lt;/code&gt; faster, give it a try. If you come up with a faster version, I'd love to see your implementation!&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Rujubu's View is now Greg's Blog</title>
    <id>tag:blog.gregspurrier.com,2010-11-07:/articles/rujubus-view-is-now-gregs-blog</id>
    <updated>2010-11-07T19:37:41Z</updated>
    <published>2010-11-07T19:36:28Z</published>
    <link href="http://blog.gregspurrier.com/articles/rujubus-view-is-now-gregs-blog"/>
    <author>
      <name>Greg Spurrier</name>
    </author>
    <content type="html">&lt;p&gt;This blog started its life as Rujubu's View in 2007 when my consulting company, Rujubu Consulting, was actively seeking business. When I relaunched the blog last month after a long period of inactivity (see &lt;a href="http://blog.gregspurrier.com/articles/relaunching-rujubus-view" title="Read Relaunching Rujubu's View"&gt;Relaunching Rujubu's View&lt;/a&gt;), I was contemplating returning to active consulting. In preparation for that, I kept the blog's name and its URL on the rujubu.com domain.&lt;/p&gt;

&lt;p&gt;Last week I decided to keep Rujubu Consulting on ice for the foreseeable future and accepted a new full-time position at a company (more on that later, perhaps). I am very interested in keeping this blog going, but no longer have a need to promote my consulting business. So, I have renamed it to "Greg's Blog" and have moved it to my personal domain.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Lazing: Lazy Enumerable Methods for Ruby 1.9</title>
    <id>tag:blog.gregspurrier.com,2010-10-24:/articles/lazing-lazy-enumerable-methods-for-ruby-1-9</id>
    <updated>2010-10-24T18:27:07Z</updated>
    <published>2010-10-24T18:21:30Z</published>
    <link href="http://blog.gregspurrier.com/articles/lazing-lazy-enumerable-methods-for-ruby-1-9"/>
    <author>
      <name>Greg Spurrier</name>
    </author>
    <content type="html">&lt;p&gt;The &lt;code&gt;select_first&lt;/code&gt; approach I wrote about in &lt;a href="/articles/selecting-only-what-you-need"&gt;Selecting Only What You Need&lt;/a&gt; addresses the need for a lazy version of &lt;code&gt;select&lt;/code&gt; in a very specific use case. It solved the problem, but left me wanting a general solution.&lt;/p&gt;

&lt;p&gt;I found a few blog posts and gems providing lazy versions of a subset of the methods defined in &lt;code&gt;Enumerable&lt;/code&gt;. I was unsatisfied with them, though, primarily because of their clunky method names. I strongly believe that code should be easy to read aloud and names like &lt;code&gt;lz_select&lt;/code&gt;, &lt;code&gt;lazy_select&lt;/code&gt;, and &lt;code&gt;select_lazy&lt;/code&gt; do not roll off the tongue.&lt;/p&gt;

&lt;p&gt;Assuming side-effect-free blocks, the use of the lazy variant will not affect the end result: it is simply a performance optimization. Knowing that the method is lazy is not essential to understanding the meaning of the code and does not need to be called out so explicitly. Someone who is taking a closer look at the code may appreciate knowing about the laziness, but the code does not need to scream out "look, I'm lazy!" to first-time readers.&lt;/p&gt;

&lt;p&gt;I prefer using the present participle form of the name to indicate the lazy variant. E.g., &lt;code&gt;selecting&lt;/code&gt; is the lazy variant of &lt;code&gt;select&lt;/code&gt;. For the casual reader, the meaning of the code is still clear without having to worry about laziness. To those looking more closely, the "ing" suffix hints that the operation is still in progress.&lt;/p&gt;

&lt;p&gt;Implementing lazy variants of methods like &lt;code&gt;select&lt;/code&gt; and &lt;code&gt;map&lt;/code&gt; is fairly trivial in Ruby 1.9 using the block form of &lt;code&gt;Enumerator.new&lt;/code&gt;. Here is the definition of &lt;code&gt;selecting&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;module Enumerable
  # Returns a lazy collection containing all elements of the collection
  # for which the provided block returns true.
  def selecting(&amp;amp;blk)
    Enumerator.new do |yielder|
      each do |item|
        yielder.yield item if blk.call(item)
      end
    end
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I have implemented lazy variants following this naming scheme for several of the methods found in &lt;code&gt;Enumerable&lt;/code&gt;.  They are packaged in a gem called &lt;a href="http://rubygems.org/gems/lazing" title="Lazing's page on RubyGems.org"&gt;lazing&lt;/a&gt; and the source can be found on github in my &lt;a href="http://github.com/gregspurrier/lazing" title="Lazing's project page on github"&gt;lazing project&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For now Lazing requires Ruby 1.9.  If there is sufficient interest in support for 1.8.7, I will look into adding it.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Selecting Only What You Need</title>
    <id>tag:blog.gregspurrier.com,2010-10-20:/articles/selecting-only-what-you-need</id>
    <updated>2010-10-22T19:48:56Z</updated>
    <published>2010-10-20T23:39:46Z</published>
    <link href="http://blog.gregspurrier.com/articles/selecting-only-what-you-need"/>
    <author>
      <name>Greg Spurrier</name>
    </author>
    <content type="html">&lt;p&gt;A couple of weeks ago I was investigating a performance problem. New Relic RPM narrowed the search and code inspection identified the culprit. With the names changed a bit, the problem was:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;items = candidates.select {|c| c.super_cool?}.first(5)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It looks innocuous, but, it turns out that &lt;code&gt;super_cool?&lt;/code&gt; is expensive to compute and &lt;code&gt;candidates&lt;/code&gt; has many members. In the common case where the first five super cool items are found within the first six or seven candidates, a lot of computation is wasted determining whether the other candidates are also super cool.&lt;/p&gt;

&lt;p&gt;At times like this, I wish that Ruby's Enumerable module was inherently lazy like Clojure's sequence library. The code above would then be much more efficient: &lt;code&gt;super_cool?&lt;/code&gt; would only be invoked enough times to satisfy the request for the first five super cool items. The remaining candidates would never be touched.&lt;/p&gt;

&lt;p&gt;To approximate that behavior, I combined the select and first into a single method called &lt;code&gt;select_first&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;module Enumerable
  # Returns an array containing the first +n+ items for which the
  # provided block returns true.
  def select_first(n)
    results = []
    each do |item|
      results &amp;lt;&amp;lt; item if yield item
      break if results.length == n
    end
    results
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This before-and-after example demonstrates that evaluation stops after the requested number of matches has been found:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# Wishing for laziness
&amp;gt;&amp;gt; a = (1..20)
 =&amp;gt; 1..20 
&amp;gt;&amp;gt; a.select {|x| raise 'boom' if x == 6; x.odd?}.first(3)
RuntimeError: boom
    from (irb):14
    from (irb):14:in `select'
    from (irb):14:in `each'
    from (irb):14:in `select'
    from (irb):14

# select_first to the rescue
&amp;gt;&amp;gt; a.select_first(3) {|x| raise 'boom' if x == 6; x.odd?}
 =&amp;gt; [1, 3, 5] 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In this case, laziness is a virtue.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Relaunching Rujubu's View</title>
    <id>tag:blog.gregspurrier.com,2010-10-20:/articles/relaunching-rujubus-view</id>
    <updated>2010-10-22T19:49:10Z</updated>
    <published>2010-10-20T19:58:10Z</published>
    <link href="http://blog.gregspurrier.com/articles/relaunching-rujubus-view"/>
    <author>
      <name>Greg Spurrier</name>
    </author>
    <content type="html">&lt;p&gt;The former incarnation of this blog was stagnate. After more than a year and a half without any new posts, I took it down until I had something new to say. That was preferable to letting it become another neglected site collecting dust on the shelves of the World Wide Web.&lt;/p&gt;

&lt;p&gt;As of today, Rujubu's View is back.&lt;/p&gt;

&lt;p&gt;Why now? The past few months have been a period of renewal for me and I find myself very excited about Ruby and Rails again. &lt;a href="http://rvm.beginrescueend.com/" title="Official RVM Website"&gt;RVM&lt;/a&gt; and &lt;a href="http://gembundler.com/" title="Official Bundler Website"&gt;Bundler&lt;/a&gt; have made it incredibly easy to experiment with and test on various Ruby interpreters and combinations of gems. I've been exploring &lt;a href="http://cukes.info/" title="Official Cucumber Website"&gt;Cucumber&lt;/a&gt; and finding it to be an extremely useful--and enjoyable--companion to RSpec.&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://weblog.rubyonrails.org/2010/8/29/rails-3-0-it-s-done" title="Rails 3.0.0 Release Announcement"&gt;release of Rails 3&lt;/a&gt;, of course, has given me a big shot of enthusiasm. I have been using it full-time since Beta 3 and am really liking the refinements and new features it brings to the table. The changes to ActiveRecord, in particular the addition of Active Relation, have allowed me to refactor some ugly, complex code to be much more readable and maintainable. The new routing system has also been a joy to work with.&lt;/p&gt;

&lt;p&gt;And then there was the &lt;a href="http://www.ruby-lang.org/en/news/2010/08/18/ruby-1-9-2-is-released/" title="Ruby 1.9.2 Release Announcement"&gt;release of Ruby 1.9.2&lt;/a&gt;. This is the first 1.9 release that I feel comfortable putting into production. Now that the &lt;a href="http://github.com/brianmario/mysql2" title="mysql2 page on Github"&gt;mysql2&lt;/a&gt; gets rid of the encoding issues that showed up with the old mysql gem and Ruby 1.9, I'll be doing that very soon.&lt;/p&gt;

&lt;p&gt;I'm inspired by the projects and releases I mentioned above as well as a lot of others. It's an exciting time to be part of the Ruby and Rails community! I have several projects and ideas for articles in the queue and I'll be posting them as they come to fruition.&lt;/p&gt;

&lt;p&gt;Welcome back.  We're going to have fun.&lt;/p&gt;
</content>
  </entry>
</feed>
