title: how do you use multiple arguments with gsub? (Ruby)
body: <p>I need to add multiple arguments to the <code>gsub</code> parenthesis, but whatever I try it doesn't seem to work.</p>
  
  <pre><code># encoding: utf-8
  # !/usr/bin/ruby
  
  # create an empty array
  original_contents = []
  # open file to read and write
  f = File.open("input.txt", "r")
  # pass each line through the array
  f.each_line do |line|
  # push edited text to the array
  
   original_contents &lt;&lt; line.gsub(/[abc]/, '*')
  
  end
  f.close
  
  new_file = File.new("output.txt", "r+")
  new_file.puts(original_contents)
  new_file.close
  </code></pre>
  
  <p>I need it so I can do a lot of different search and replaces like this:</p>
  
  <pre><code>original_contents &lt;&lt; line.gsub(/[abc]/, '*' || /[def]/, '&amp;' || /[ghi]/, '£')
  </code></pre>
  
  <p>Of course I know this code doesn't work but you get the idea. I've tried using an array for each argument but it ends up printing the text into the output file multiple times.
  Any ideas?</p>