title: Ruby search and replace across files
body: <p>I am trying to write a ruby script which will look in a directory and its subdirectories for HTML files, open those HTML files and insert the following line just above the closing head tag:</p>
  
  <pre><code>&lt;link rel="stylesheet" href="styles.css" type="text/css" /&gt;
  </code></pre>
  
  <p>I am trying to do this with Ruby because its the only language I am familar with but have access to pretty much any language.  Could anyone lend a hand?</p>
  
  <p>Cheers</p>
  
  <p>Eef</p>