title: Replace content in a file between two markers
body: <p>Using ruby (not rails), I'm trying to figure out how to replace (not append) a certain block in a static file with a string. For example, in static_file.html I want to replace everything between the html comments "start" and "end":</p>
  
  <pre><code>&lt;p&gt;lorem ipsum blah blah ipsum&lt;/p&gt;
  
  &lt;!--start--&gt;
  REPLACE MULTI-LINE
  CONTENT HERE...
  &lt;!--end--&gt;
  
  &lt;p&gt;other stuff still here...&lt;/p&gt;
  </code></pre>
  
  <p>Some of the <a href="https://stackoverflow.com/questions/2139058/how-to-insert-a-string-into-a-textfile">answers here</a> are helpful for inserting text at a certain spot, but does not handle between. </p>