def parse_query(s)
if s.count(':') == 0
return s
...
Ruby Parsing key value with no d...
Input: "the big state:activ...
class String def titlecap ...
Ruby Ruby Title Caps method
by SmackTurtle,
October 05, 2010 21:06,
7 refactorings, tagged with string, ruby, Capitalize, titlecaps, dangerous
Capitalizes the first lette...
def dedent()
sRaw = self;
sep = "\n";
...
Ruby ruby dedent whitespace in a...
by dreftymac.myopenid.com,
March 05, 2010 16:37,
4 refactorings, tagged with string, ruby, monkeypatch
Remove leading whitespace f...
def compress(source)
source.gsub!(/\s+/, " ") # collapse space
source.gsub!(/\/\*(.*?)\*\//, "") # remove comments - caution, might want to remove this if using css hacks
...
Ruby Gsubing
There is a lot of repetitio...
class Race < ActiveRecord::Base ...
Ruby Help generating abbreviatio...
by Michael Filbin,
April 06, 2008 16:16,
3 refactorings, tagged with string, model, abbreviation, attribute
Hi all,
I am attempting ...
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...
not good enough(