On Tue, May 10, 2011 at 10:12 PM, Adam Prescott <adam / aprescott.com> wrote:

> characters = ("A".."Z").to_a + ("a".."z").to_a # there is a shortcut to
> this in 1.9, but it escapes me.
> characters << "-"
>
> 10.times.map { a << b.sample }
>

To rectify this abomination, it comes from two ways:

a = []
# this was the b:
characters = ("A".."Z").to_a + ("a".."z").to_a
characters << "-"

10.times { a << characters.sample }
a.join("")


or


characters = ("A".."Z").to_a + ("a".."z").to_a
characters << "-"

10.times.map { characters.sample }.join("")