def init_from_template(templatedir, rootdir, config = {},
                           options = {
                             :erb_exclude    => [],
                             :no_interaction => false
                           })
      error "Unable to find the template directory" unless File.directory?(templatedir)
      warning "about to initialize/update the directory #{rootdir}"
      really_continue? unless options[:no_interaction]
      run %( mkdir -p #{rootdir} ) unless File.directory?( rootdir )
      run %( rsync --exclude '*.erb' --exclude '.texinfo*' -avzu #{templatedir}/ #{rootdir}/ )
      Dir["#{templatedir}/**/*.erb"].each do |erbfile|
        relative_outdir = Pathname.new( File.realpath( File.dirname(erbfile) )).relative_path_from Pathname.new(templatedir)
        filename = File.basename(erbfile, '.erb')
        outdir   = File.realpath( File.join(rootdir, relative_outdir.to_s) )
        outfile  = File.join(outdir, filename)
        unless options[:erb_exclude].nil?
          exclude_entry = false
          options[:erb_exclude].each do |pattern|
            exclude_entry |= erbfile =~ /#{pattern}/
          end
          if exclude_entry
            info "copying non-interpreted ERB file"
            # copy this file since it has been probably excluded from teh rsync process
            run %( cp #{erbfile} #{outdir}/ )
            next
          end
        end
        # Let's go
        info "updating '#{relative_outdir}/#{filename}'"
        puts "  using ERB template '#{erbfile}'"
        write_from_erb_template(erbfile, outfile, config, options)
      end
    end
def init_from_template(templatedir, rootdir, config = {},
                           options = {
                             :erb_exclude    => [],
                             :no_interaction => false
                           })
      error "Unable to find the template directory" unless File.directory?(templatedir)
      warning "about to initialize/update the directory #{rootdir}"
      really_continue? unless options[:no_interaction]
      run %( mkdir -p #{rootdir} ) unless File.directory?( rootdir )
      run %( rsync --exclude '*.erb' --exclude '.texinfo*' -avzu #{templatedir}/ #{rootdir}/ )
      Dir["#{templatedir}/**/*.erb"].each do |erbfile|
        relative_outdir = Pathname.new( File.realpath( File.dirname(erbfile) )).relative_path_from Pathname.new(templatedir)
        filename = File.basename(erbfile, '.erb')
        outdir   = File.realpath( File.join(rootdir, relative_outdir.to_s) )
        outfile  = File.join(outdir, filename)
        unless options[:erb_exclude].nil?
          exclude_entry = false
          options[:erb_exclude].each do |pattern|
            exclude_entry |= erbfile =~ /#{pattern}/
          end
          if exclude_entry
            info "copying non-interpreted ERB file"
            # copy this file since it has been probably excluded from teh rsync process
            run %( cp #{erbfile} #{outdir}/ )
            next
          end
        end
        # Let's go
        info "updating '#{relative_outdir}/#{filename}'"
        puts "  using ERB template '#{erbfile}'"
        write_from_erb_template(erbfile, outfile, config, options)
      end
    end
[ERB] template generation 

 Bootstrap the destination directory `rootdir` using the template
 directory `templatedir`. the hash table `config` hosts the elements to
 feed ERB files which **should** have the extension .erb.
 The initialization is performed as follows:
 * a rsync process is initiated to duplicate the directory structure
   and the symlinks, and exclude .erb files
 * each erb files (thus with extension .erb) is interpreted, the
   corresponding file is generated without the .erb extension
 Supported options:
   :erb_exclude [array of strings]: pattern(s) to exclude from erb file
                                    interpretation and thus to copy 'as is'
   :no_interaction [boolean]: do not interact