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

by marko.z, October 31, 2008 09:44, 2 refactorings, tagged with ruby, string, css, gsub

There is a lot of repetitio...

Bd9893bfd15fa7b443d112607b937734 Talk
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 ...

14b8667b3bdf64068647b96c26001e0d Talk
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?

by Gary Haran, October 30, 2007 15:29, 6 refactorings, tagged with string, class, postal

We've had the debate over w...

403e57e2be130d2218f992b86dfa8260 Talk