Skip to content

Instantly share code, notes, and snippets.

@latentflip
Forked from morganp/unix_gen_dictionary.rb
Created July 16, 2010 15:56
Show Gist options
  • Save latentflip/478531 to your computer and use it in GitHub Desktop.
Save latentflip/478531 to your computer and use it in GitHub Desktop.
#Small function to generate a comma delimited dictionary on a unix system
def gen_dictionary
f = open("| cat /usr/share/dict/words")
g = Array.new
while (foo = f.gets)
g << foo.strip
end
puts g.join(', ')
end
gen_dictionary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment