Código
#!usr/bin/ruby #Funcion openwords() #Coded By Doddy H def openwords(file) if File.file?(file) print "[+] Opening file\n\n" ar = File.open(file) lineas = ar.readlines ar.close print "[+] Number of words : ",lineas.length,"\n\n" return lineas else print "[-] Error opening file\n" end end words = openwords("test.txt") words.each do |word| word = word.chomp print "[+] Word : ",word end #The End ?