title: Is there an easier way to insert a time stamp into a file name with Ruby?
body: <p>Is there an easier way to insert a time stamp in a file name ?</p>
  
  <pre><code>def time_stamped_file(file)
    file.gsub(/\./,"_" + Time.now.strftime("%m-%d_%H-%M-%S") + '.') 
  end
  
  f = "test.txt"
  puts time_stamped_file(f) 
  
  
  =&gt; test_01-24_12-56-33.txt
  </code></pre>