title: Ruby read/write to file in 1 line of code
body: <p>I am kind of a newbie to Ruby, I am working out some katas and I stuck on this silly problem. I need to copy the content of 1 file to a new file in 1 line of code</p>
  
  <p>First try:</p>
  
  <pre><code>File.open(out, 'w').write(File.open(in).read)
  </code></pre>
  
  <p>Nice, but it's wrong I need to close the files:</p>
  
  <pre><code>File.open(out, 'w') { |outf| outf.write(File.open(in).read) }
  </code></pre>
  
  <p>And then of course close the read:</p>
  
  <pre><code>File.open(out, 'w') { |outf| File.open(in) { |inf| outf.write(outf.read)) } }
  </code></pre>
  
  <p>This is what I come up with, but it does not look like 1 line of code to me :(</p>
  
  <p>Ideas?</p>
  
  <p>Regards, </p>