support/ruby/collins-notify/lib/collins_notify/adapter/helper/carried-pigeon.rb
def gen_nick name
    names = name.split('_')
    if names.size == 1 then
      "#{name}_1"
    elsif names.last.to_i > 0 then
      num = names.pop.to_i
      if num > 10 then
        raise "Too many nicknames generated (10)"
      end
      "#{names.join('_')}_#{num + 1}"
    else
      "#{name}_1"
    end
  end
# Generate a nickname, useful if yours is taken
Generate a nickname, useful if yours is taken
Generate a nickname useful if yours is taken
def gen_nick name
    names = name.split('_')
    if names.size == 1 then
      "#{name}_1"
    elsif names.last.to_i > 0 then
      num = names.pop.to_i
      if num > 10 then
        raise "Too many nicknames generated (10)"
      end
      "#{names.join('_')}_#{num + 1}"
    else
      "#{name}_1"
    end
  end
def gen_nick name names = name . split ( '_' ) if names . size == 1 then "#{name}_1" elsif names . last . to_i > 0 then num = names . pop . to_i if num > 10 then raise "Too many nicknames generated (10)" end "#{names.join('_')}_#{num + 1}" else "#{name}_1" end end
Generate a nickname, useful if yours is taken
Generate a nickname useful if yours is taken
name