1 2 3 4
def compress(source) source.gsub!(/\s+/, " ") # collapse space source.gsub!(/\/\*(.*?)\*\//, "") # remove comments - caution, might want to remove this if using css hacks ...
Ruby Gsubing
1 2 3
class Race < ActiveRecord::Base ...
Ruby Help generating abbreviatio...
by Michael Filbin,
April 06, 2008 16:16,
2 refactorings, tagged with abbreviation, string, model, attribute
Hi all,
I am attempting ...
1 2 3 4
class String def postal? self.match(/[a-zA-Z]{1}\d{1}[a-zA-Z]{1}([\x20-])*\d{1}[a-zA-Z]{1}\d{1}/) ? true : false ...
Ruby Is This String Postal?
We've had the debate over w...
There is a lot of repetitio...