How can I open a file and search for a word inside it using Ruby?
Something like this might help:
def word_exists_in_file f = File.open("your_file.txt") #opens the file for reading f.each do line print line if line.match /your_word_to_match/ return true end end false end