Live and Learn

April 19th, 2010  |  Published in ruby

Well, from yesterday’s entry on Ruby and Joomla and such:


First, I guess article_alias.gsub!(/\-+/,"-") is less noisy by three characters. I don’t know how I got into the habit of using intervals instead of quantifiers, but it’s all over the place in my scripts.

Second, just this morning, Ruby Quicktips pointed out the “squeeze” method, which would work like this:



Leave a Response

© Michael Hall, licensed under a Creative Commons Attribution-ShareAlike 3.0 United States license.