def write_from_template(src, dstdir, options = {
      :no_interaction => false,
      :no_commit      => false,
      :srcdir         => '',
      :outfile        => ''
    })
      srcfile = (options[:srcdir].nil?) ? src : File.join(options[:srcdir], src)
      error "Unable to find the source file #{srcfile}" unless File.exist?( srcfile )
      error "The destination directory '#{dstdir}' do not exist" unless File.directory?( dstdir )
      dstfile = (options[:outfile].nil?) ? File.basename(srcfile) : options[:outfile]
      outfile = File.join(dstdir, dstfile)
      content = File.read( srcfile )
      show_diff_and_write(content, outfile, options)
    end
def write_from_template(src, dstdir, options = {
      :no_interaction => false,
      :no_commit      => false,
      :srcdir         => '',
      :outfile        => ''
    })
      srcfile = (options[:srcdir].nil?) ? src : File.join(options[:srcdir], src)
      error "Unable to find the source file #{srcfile}" unless File.exist?( srcfile )
      error "The destination directory '#{dstdir}' do not exist" unless File.directory?( dstdir )
      dstfile = (options[:outfile].nil?) ? File.basename(srcfile) : options[:outfile]
      outfile = File.join(dstdir, dstfile)
      content = File.read( srcfile )
      show_diff_and_write(content, outfile, options)
    end
Blind copy of a source file `src` into its destination directory `dstdir`
 Supported options:
   :no_interaction [boolean]: do not interact
   :srcdir [string]: source directory, make the `src` file relative to that directory
   :outfile [string]: alter the outfile name (File.basename(src) by default)
   :no_commit [boolean]:          do not (offer to) commit the changes