class UserAgent::Version
def <=>(other)
def <=>(other) case other when Version if @comparable ([0]*6).zip(to_a, other.to_a).each do |dump, a, b| a ||= 0 b ||= 0 if a.is_a?(String) && b.is_a?(Integer) return -1 elsif a.is_a?(Integer) && b.is_a?(String) return 1 elsif a == b next else return a <=> b end end 0 elsif to_s == other.to_s return 0 else return -1 end when String, NilClass self <=> self.class.new(other) else nil end end