def template_upload(*paths)
      remote_path = paths.pop
      templates = []
      paths.collect! do |path|      
        if StringIO === path
          path.rewind
          template = Rye::Tpl.new(path.read, "inline-template")
        elsif String === path
          raise "No such file: #{Dir.pwd}/#{path}" unless File.exists?(path)
          template = Rye::Tpl.new(File.read(path), File.basename(path))
        end
        template.result!(binding)
        templates << template
        template.path
      end
      paths << remote_path
      ret = self.file_upload *paths
      templates.each { |template| 
        tmp_path = File.join(remote_path, File.basename(template.path))
        if file_exists?(tmp_path)
          mv tmp_path, File.join(remote_path, template.basename)
        end
        template.delete 
      }
      ret
    end
def template_upload(*paths)
      remote_path = paths.pop
      templates = []
      paths.collect! do |path|      
        if StringIO === path
          path.rewind
          template = Rye::Tpl.new(path.read, "inline-template")
        elsif String === path
          raise "No such file: #{Dir.pwd}/#{path}" unless File.exists?(path)
          template = Rye::Tpl.new(File.read(path), File.basename(path))
        end
        template.result!(binding)
        templates << template
        template.path
      end
      paths << remote_path
      ret = self.file_upload *paths
      templates.each { |template| 
        tmp_path = File.join(remote_path, File.basename(template.path))
        if file_exists?(tmp_path)
          mv tmp_path, File.join(remote_path, template.basename)
        end
        template.delete 
      }
      ret
    end
Parse a template and upload that as a file to remote_path.