title: Applying a diff-patch to a string/file
body: <p>For an offline-capable smartphone app, I'm creating a one-way text sync for Xml files. I'd like my server to send the delta/difference (e.g. a GNU diff-patch) to the target device. </p>
  
  <p>This is the plan:</p>
  
  <pre><code>Time = 0
  Server: has version_1 of Xml file (~800 kiB)
  Client: has version_1 of Xml file (~800 kiB)
  
  Time = 1
  Server: has version_1 and version_2 of Xml file (each ~800 kiB)
          computes delta of these versions (=patch) (~10 kiB) 
          sends patch to Client (~10 kiB transferred)
  
  Client: computes version_2 from version_1 and patch  &lt;= this is the problem =&gt;
  </code></pre>
  
  <p>Is there a Ruby library that can do this last step to apply a text patch to files/strings? The patch can be formatted as required by the library. </p>
  
  <p>Thanks for your help!</p>
  
  <p>(I'm using the Rhodes Cross-Platform Framework, which uses Ruby as programming language.)</p>