I just started learning Ruby.
I need to replace some lines in a file, which are having a specific string in it.
How to append the file using Ruby?
I have tried different approaches, including:
file_names.each do |file_name|
text = File.read(file_name)
puts text.gsub(/search_regexp/, "replace string")
end