I'm new to ruby and was hoping someone could help me figure out how to open a file, then using gsub to find and replace by multiple conditions.
Here's what I got so far but this doesn't seem to work as the 2nd replace var overrides the first:
text = File.read(filepath)
replace = text.gsub(/aaa/, "Replaced aaa with 111")
replace = text.gsub(/bbb/, "Replace bbb with 222")
File.open(filepath, "w") {|file| file.puts replace}