title: How can I shrink this code to a one-liner?
body: <p>I am using <code>CarrierWave</code> and find myself doing this all the time:</p>
  
  <pre><code>fin = File.open(payload_file_name,'rb')
  self.payload = fin
  fin.close
  </code></pre>
  
  <p>where <code>payload</code> is my <code>CarrierWave</code> field. I considered doing:</p>
  
  <pre><code>self.payload = File.open(payload_file_name,'rb')
  </code></pre>
  
  <p>but I was concerned it would leave the file open and my app server would eventually run out of file pointers. Is there a Rubyism that will let me assign the return value of a simple block to a variable?</p>