<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <id>tag:www.refactormycode.com,2007:users1485</id>
  <link type="application/atom+xml" href="http://www.refactormycode.com/users/1485" rel="self"/>
  <title>Muke Tever</title>
  <updated>Fri Jul 16 22:57:02 -0700 2010</updated>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor520203</id>
    <published>2010-07-16T22:57:02-07:00</published>
    <title>[Ruby] On default value if not defined yet</title>
    <content type="html">&lt;p&gt;Depending on how you were using this, you might not even need a function.&lt;/p&gt;

&lt;pre&gt;# If you were doing something like this in your code:
session[:orientation] = setOrDefault

# Then you can just do this instead:
session[:orientation] ||= app_config(&amp;quot;orientation&amp;quot;)&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/1353-default-value-if-not-defined-yet/refactors/520203" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor369603</id>
    <published>2009-11-23T00:21:19-08:00</published>
    <title>[Ruby] On Numeric#evenize</title>
    <content type="html">&lt;p&gt;The above don't seem to handle fractions, as I assume you might want, given it's being attached to Numeric and not, say, Integer.&lt;/p&gt;

&lt;p&gt;I agree with danielharan about separating evenizing upwards from evenizing downwards, if only because passing &amp;quot;+&amp;quot; or &amp;quot;-&amp;quot; is arbitrary based on the implementation.   But you wanted a different way, so:&lt;/p&gt;

&lt;pre&gt;class Numeric
  def evenize_ceil
    self.quo(2).ceil * 2
  end
  
  def evenize_floor
    self.quo(2).floor * 2
  end
  
  def oddize_ceil
    (self - 1).evenize_ceil + 1
  end
  
  def oddize_floor
    (self - 1).evenize_floor + 1 
  end


  # if you insist
  def evenize(upwards = true)
    upwards ? evenize_ceil : evenize_floor
  end

  def oddize(upwards = true)
    upwards ? oddize_ceil : oddize_floor
  end

  # Bonus methods - round to the nearest even or odd number.
  def evenize_round
    (self + 1).evenize_floor
  end 

  def oddize_round
    (self + 1).oddize_floor
  end
end&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/1104-numeric-evenize/refactors/369603" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor360262</id>
    <published>2009-11-14T17:07:53-08:00</published>
    <title>[Ruby] On lexer</title>
    <content type="html">&lt;p&gt;I think you *could* use find, if you really wanted to; just move 'val' outside of the find block's scope.&lt;/p&gt;

&lt;pre&gt;def get_token
  val = nil
  self.class.precedence.find {|token| val = send(token) }
  val || error('syntax error')
end

# with val in the method signature you could, say, 
# specify a fallback value instead of an error sometimes
# (if that makes sense in this context; I don't know)
def get_token(val=nil)
  self.class.precedence.find {|token| if x = send(token) then val = x end } 
  val || error('syntax error')
end

&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/1098-lexer/refactors/360262" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor347125</id>
    <published>2009-10-24T03:45:34-07:00</published>
    <title>[Ruby] On Ruby - Chained collect statements ...</title>
    <content type="html">&lt;p&gt;I had a lot of these in my app...  You're going to want something like this.  (The exact syntax re singular and plural in :joins will depend on how your relationships are defined&#226;&#8364;&#8221;my solution assumes they're all belongs_to and no habtms&#226;&#8364;&#8221;but the hash will basically be a map connecting Number with User.)&lt;/p&gt;

&lt;pre&gt;## Using this... 

Number.find(:all, 
    :joins =&amp;gt; { :metric =&amp;gt; { :report_card =&amp;gt; { :student =&amp;gt; :user } } },
    :conditions =&amp;gt; { :users =&amp;gt; { :id =&amp;gt; user.id } })

## ...will produce SQL something like this [sql_rails]

SELECT &amp;quot;numbers&amp;quot;.* 
FROM &amp;quot;numbers&amp;quot; 
INNER JOIN &amp;quot;metrics&amp;quot; ON &amp;quot;metrics&amp;quot;.id = &amp;quot;numbers&amp;quot;.metric_id 
INNER JOIN &amp;quot;report_cards&amp;quot; ON &amp;quot;report_cards&amp;quot;.id = &amp;quot;metrics&amp;quot;.report_card_id 
INNER JOIN &amp;quot;students&amp;quot; ON &amp;quot;students&amp;quot;.id = &amp;quot;report_cards&amp;quot;.student_id 
INNER JOIN &amp;quot;users&amp;quot; ON &amp;quot;users&amp;quot;.&amp;quot;id&amp;quot; = &amp;quot;students&amp;quot;.&amp;quot;user_id&amp;quot; 
WHERE (&amp;quot;users&amp;quot;.&amp;quot;id&amp;quot; = 1) &lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/1079-ruby-chained-collect-statements/refactors/347125" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor340605</id>
    <published>2009-10-12T12:15:55-07:00</published>
    <title>[Ruby] On retry</title>
    <content type="html">&lt;p&gt;Well, it looks fine.  Though IMO it looks like it ought to be parallel to &amp;quot;3.times do&amp;quot;, so:&lt;/p&gt;

&lt;pre&gt;class Integer
  def tries options = {}, &amp;amp;block
    return if self &amp;lt; 1
    yield attempts ||= 1
  rescue options[:ignoring] || Exception
    retry if (attempts += 1) &amp;lt;= self
  end
end

## Examples
3.tries { open 'http://vision-media.ca' }

3.tries do |i| 
  puts &amp;quot;Try ##{i} at opening...&amp;quot;
  open 'http://vision-media.ca' 
end

3.tries(:ignoring =&amp;gt; ParticularException) do
  open 'http://vision-media.ca' 
end

# etc.&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/1065-retry/refactors/340605" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor335610</id>
    <published>2009-10-07T06:41:15-07:00</published>
    <title>[Ruby] On Pagination total page count</title>
    <content type="html">&lt;p&gt;And no need to convert total either, necessarily.   'quo' is slightly faster than the 'to_f' + '/' combo, too, if you feel like straining at gnats.&lt;/p&gt;

&lt;pre&gt;@total_pages = total.quo(per_page).ceil&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/1060-pagination-total-page-count/refactors/335610" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor334064</id>
    <published>2009-10-06T06:29:48-07:00</published>
    <title>[Ruby] On Parse a querystring</title>
    <content type="html">&lt;p&gt;And if for any reason you don't want to do require 'cgi', this is a shorter way of doing what you were doing:&lt;/p&gt;

&lt;pre&gt;Hash[*q.split(/=|&amp;amp;/)]&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/1058-parse-a-querystring/refactors/334064" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor313647</id>
    <published>2009-09-20T21:15:50-07:00</published>
    <title>[Ruby] On Ugly split/join</title>
    <content type="html">&lt;p&gt;Doesn't apply to the immediate problem (of _un_bolding the pipes), but taken a level up does obviate the need for what I was doing, so that's even better.  :x)&lt;/p&gt;

&lt;p&gt;But your code doesn't handle the case which complicated my original, where there's more than one pipe between the brackets (in other words, I still needed [[one|two'''|'''three]] to happen).  I modified your code a bit and came up with this, which seems (so far) to work exactly right:&lt;/p&gt;

&lt;pre&gt;  def bold_around_pipes (str)
    stack, functional = 0, false
    &amp;quot;'''#{str}'''&amp;quot;.each_char.inject('') do |memo, char|
      case char
      when '[' then stack, functional = stack + 1, true
      when ']' then stack, functional = stack - 1, !stack.zero?
      when '|' then stack.zero? || !functional ? char = &amp;quot;'''|'''&amp;quot; : functional = false
      end
      memo + char
    end
  end&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/977-ugly-split-join/refactors/313647" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor304854</id>
    <published>2009-09-11T06:00:21-07:00</published>
    <title>[Ruby] On ungliness and long too</title>
    <content type="html">&lt;p&gt;Not a refactoring (the above seem to cover it), but sort of a bug warning:&lt;/p&gt;

&lt;pre&gt;name = &amp;quot;female&amp;quot;

if name =~ /male/ 
  # (Doing stuff for the male case...)
  # /male/ matches &amp;quot;female&amp;quot; so this will get called for females too
  # You'll be ending up with a lot of girls in the guys' dorm.
elsif name =~ /female/
  # (Theoretically doing other stuff for the female case...)
  # ...but this won't get called because we already matched /male/
  # Best to switch the order of these conditions if you do regexp matches
end

&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/1030-ungliness-and-long-too/refactors/304854" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor295708</id>
    <published>2009-09-06T03:45:15-07:00</published>
    <title>[Ruby] On Massive if/elsif statement needs major refactoring...I think.</title>
    <content type="html">&lt;p&gt;I discovered a new hammer today (so every problem looks like a nail...), and even though this is an old post it felt like a nail worth pounding.&lt;/p&gt;

&lt;pre&gt;birthinfo = &amp;quot;&amp;lt;p class='birthinfo'&amp;gt;%s %s %s %s&amp;lt;/p&amp;gt;&amp;quot; % [name, 
  if birthdate.present? || location.present? then &amp;quot;was born %s%s%s.&amp;quot; % [
      (&amp;quot;on %s&amp;quot; % birthdate.strftime(&amp;quot;%A, %B %e, %Y&amp;quot;) unless birthdate.blank?), 
      (&amp;quot;in %s&amp;quot; % location unless location.blank?),
      (&amp;quot;and is %s old&amp;quot; % time_ago_in_words(birthdate) if birthdate.present? &amp;amp;&amp;amp; death.blank?)  
  ] else member_of_info end,
  if death.present? then &amp;quot;%s passed away on %s%s.&amp;quot; % [sex, death.strftime(&amp;quot;%B %e, %Y&amp;quot;),
      (&amp;quot;at the age of %d&amp;quot; % calculate_age(birthdate, death) if birthdate.present?)
  ] end,
  if birthdate.present? || location.present? then &amp;quot;%s %s&amp;quot; % [sex, member_of_info] end
]

def member_of_info 
  &amp;quot;%s a member of %s's family%s.&amp;quot; % [
    death.blank? ? if joined.blank? then &amp;quot;is&amp;quot; else &amp;quot;has been&amp;quot; end : &amp;quot;was&amp;quot;,
    link_to(user.login, profile_path(user.permalink)),
    (&amp;quot; for %s&amp;quot; % death.present? ? distance_of_time_in_words(joined,death) : time_ago_in_words(joined) if joined.present?)
  ]
end&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/975-how-can-i-make-this-massive-ruby-if-elsif-statement-more-compact-and-cleaner/refactors/295708" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor266315</id>
    <published>2009-08-21T15:14:38-07:00</published>
    <title>[Ruby] On Case statement with Regular Expression</title>
    <content type="html">&lt;p&gt;And here's the same thing without a separate statement to check 'string'.&lt;/p&gt;

&lt;pre&gt;xx = case string[/1/] || host[/(a|fd|na|op)/]
     when '1'  then 1
     when 'a'  then &amp;quot;fd&amp;quot;
     when 'fd' then &amp;quot;wq&amp;quot;
     when 'na' then &amp;quot;sa&amp;quot;
     when 'op' then &amp;quot;l&amp;quot;
     end&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/1009-case-statement-with-regular-expression/refactors/266315" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor265444</id>
    <published>2009-08-21T00:37:06-07:00</published>
    <title>[Ruby] On Case statement with Regular Expression</title>
    <content type="html">&lt;p&gt;Tried to make it look nicer, if nothing else.   Some of the answers posted call regexps too often for my taste ;)   You could use a hash, yeah, but you also asked for a case statement with a regular expression, so here you go.&lt;/p&gt;

&lt;p&gt;[Edited because the regexp didn't need to be in its own variable really...]&lt;/p&gt;

&lt;pre&gt;xx = string.include?(&amp;quot;1&amp;quot;) ? 1 :
     case host[/(a|fd|na|op)/]
     when 'a'  then &amp;quot;fd&amp;quot;
     when 'fd' then &amp;quot;wq&amp;quot;
     when 'na' then &amp;quot;sa&amp;quot;
     when 'op' then &amp;quot;l&amp;quot;
     end&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/1009-case-statement-with-regular-expression/refactors/265444" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor240697</id>
    <published>2009-08-07T05:52:22-07:00</published>
    <title>[Ruby] On [Ruby] Iterating...</title>
    <content type="html">&lt;p&gt;It seems kind of like reinventing the wheel, anyway. &lt;/p&gt;

&lt;p&gt;P.S. I love the 'edit' button a bit too much.&lt;/p&gt;

&lt;pre&gt;## Conjecture
# It looks like you're trying to set up for something like this: 

while (yourcontainer.has_next?) do
  item = yourcontainer.get_next 
  # do stuff with item here
end

## Advice
# If that's the case, you don't need an IterableContainer class. 
# The functionality is built-in with arrays, and looks like this:

yourarray.each do |item|
  # do stuff with item here
end

# If having access to the index is necessary, you can do that too:

yourarray.each_with_index do |item, index|
  # do stuff with item and index here
end
&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/988-ruby-iterating/refactors/240697" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor233229</id>
    <published>2009-08-03T18:02:12-07:00</published>
    <title>[Ruby] On dual object creating in Rails</title>
    <content type="html">&lt;p&gt;Old book, eh?  Have you looked up the new 'nested attributes' and accepts_nested_attributes_for ? That should handle much of this for you.&lt;/p&gt;

&lt;pre&gt;&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/980-rector-dual-object-creating-in-rails/refactors/233229" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor230875</id>
    <published>2009-08-02T06:11:23-07:00</published>
    <title>[Ruby] On Search Filters</title>
    <content type="html">&lt;p&gt;I haven't used searchlogic, so I can't answer those; this is just a sort of cleanup refactor of what you were doing to begin with ..&lt;/p&gt;

&lt;pre&gt;class LoginAttempt &amp;lt; ActiveRecord::Base
  belongs_to :user
  
  def self.search(params)
    conditions = {
      :result =&amp;gt; params[:result],
      :user_id =&amp;gt; find_user_id_by_params(params),
      'created_at &amp;gt; ?' =&amp;gt; params[:start_date],
      'created_at &amp;lt; ?' =&amp;gt; params[:end_date]
    }.delete_if {|k, v| v.blank?}

    find(:all, :conditions =&amp;gt; conditions)
  end
  
  # You still need to define behaviour for if no user is returned
  # You could generalize this if the params you use are subject to variation
  def find_user_id_by_params(params)
    case
    when params[:login].present? then User.find_by_login(params[:login]).id
    when params[:name].present? then User.find_by_name(params[:name]).id
    when params[:email].present? then User.find_by_email(params[:email]).id
    end
  end
end&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/979-search-filters/refactors/230875" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Code977</id>
    <published>2009-07-30T19:52:27-07:00</published>
    <updated>2009-09-21T00:52:02-07:00</updated>
    <title>[Ruby] Ugly split/join</title>
    <content type="html">&lt;p&gt;This is supposed to be taking a string in 'wiki bold' (i.e. where &amp;quot;'''&amp;quot; represents begin bold and end bold) and unbolding the &amp;quot;|&amp;quot; signs.  (I suppose you could also use it to bold &amp;quot;|&amp;quot; signs in non-wikibold text...)&lt;/p&gt;

&lt;p&gt;The first split-join would do this in most cases, but... if there are pipes between pairs of square brackets in the input string, then the first pipe between each pair of square brackets serves a different function and shouldn't be replaced, so the last few lines are the kludge to do this.&lt;/p&gt;

&lt;p&gt;Been trying to find a better way but it's been eluding me.  I would have liked to do it in one split/join but can't seem to find a regexp to handle the condition.  I'm sure there's something simple I'm overlooking.&lt;/p&gt;

&lt;pre&gt;def unbold_pipes (wikibold_string)
     wikibold_string.
      split('|').
      join(&amp;quot;'''|'''&amp;quot;).
      split(/(.*\[\[.+?)'''\|'''(.+?\]\].*)/). 
      delete_if {|x| x == &amp;quot;&amp;quot; }.
      join(&amp;quot;|&amp;quot;)
end&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/977-ugly-split-join" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor225729</id>
    <published>2009-07-30T15:25:29-07:00</published>
    <title>[Ruby] On Massive if/elsif statement needs major refactoring...I think.</title>
    <content type="html">&lt;p&gt;I seem to have thrown a stray 'else = &amp;quot;&amp;quot;' in.  The heck? -.-&lt;/p&gt;

&lt;pre&gt;&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/975-how-can-i-make-this-massive-ruby-if-elsif-statement-more-compact-and-cleaner/refactors/225729" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor225728</id>
    <published>2009-07-30T15:23:49-07:00</published>
    <title>[Ruby] On Massive if/elsif statement needs major refactoring...I think.</title>
    <content type="html">&lt;p&gt;I tried to take it apart a bit.&lt;/p&gt;

&lt;p&gt;(Haven't tested this, but I think the idea is there.)&lt;/p&gt;

&lt;pre&gt;# first sentence
birthinfo = &amp;quot;&amp;lt;p class='birthinfo'&amp;gt;#{name} &amp;quot; 
if birthdate.present? || location.present? {
  birthinfo &amp;lt;&amp;lt; &amp;quot;was born &amp;quot; + 
  &amp;quot;#{&amp;quot; on&amp;quot; + birthdate.strftime(&amp;quot;%A, %B %e, %Y&amp;quot;) unless birthdate.blank}&amp;quot; + 
  &amp;quot;#{&amp;quot; in&amp;quot; + location unless location.blank}&amp;quot; + 
  &amp;quot;#{&amp;quot; and is&amp;quot; + time_ago_in_words(birthdate) + &amp;quot;old&amp;quot; if birthdate.present? &amp;amp;&amp;amp; death.blank?}&amp;quot; + 
  &amp;quot;. &amp;quot;
} else {
  birthinfo &amp;lt;&amp;lt; member_of_info
} 
  
# second sentence
if death.present? {
  birthinfo &amp;lt;&amp;lt; &amp;quot;#{sex} passed away on #{death.strftime(&amp;quot;%B %e, %Y&amp;quot;)}&amp;quot; + 
  &amp;quot;#{&amp;quot; at the age of &amp;quot; + calculate_age(birthdate, death) if birthdate.present?}&amp;quot; + 
  &amp;quot;. &amp;quot;
}

# third sentence
if birthdate.present? || location.present? {
  birthinfo &amp;lt;&amp;lt; &amp;quot;#{sex} &amp;quot; + member_of_info
}


# rather than having it out there twice:
def member_of_info 
  returning &amp;quot;&amp;quot; do |str| 
    str &amp;lt;&amp;lt; 
    case 
    when joined.blank? &amp;amp;&amp;amp; death.blank?     then &amp;quot;is &amp;quot;
    when joined.present? &amp;amp;&amp;amp; death.blank?   then &amp;quot;has been &amp;quot;
    when death.present?                    then &amp;quot;was &amp;quot;
    end + 
    &amp;quot;a member of #{link_to user.login, profile_path(user.permalink)}'s family&amp;quot;
    if joined.present? {
      str &amp;lt;&amp;lt; 
      (death.present? ?
        &amp;quot; for #{distance_of_time_in_words(joined,death)}&amp;quot; :
        &amp;quot; for #{time_ago_in_words(joined)}&amp;quot;) 
    } 
    str &amp;lt;&amp;lt; &amp;quot;.&amp;lt;/p&amp;gt;&amp;quot;
  end
end&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/975-how-can-i-make-this-massive-ruby-if-elsif-statement-more-compact-and-cleaner/refactors/225728" rel="alternate"/>
  </entry>
  <entry>
    <id>tag:www.refactormycode.com,2007:Refactor156234</id>
    <published>2009-05-03T23:34:43-07:00</published>
    <title>[Ruby] On Count words in a string</title>
    <content type="html">&lt;p&gt;Twice as slow for this, and much, much slower working with larger strings!  Oh my.&lt;/p&gt;

&lt;pre&gt;&lt;/pre&gt;</content>
    <author>
      <name>Muke Tever</name>
      <email>muke@frath.net</email>
    </author>
    <link type="text/html" href="http://www.refactormycode.com/codes/856-count-words-in-a-string/refactors/156234" rel="alternate"/>
  </entry>
</feed>

