nadarei/mina — pull request #38 by dariocravero (2012-08-03 17:39:08+00:00)
Title: Implemented text file upload to the server and rendering of templates.

Hi all,

A common case scenario while deploying an app is to create configuration files on the fly such as a database config file.

I don't know how you're currently handling this and given the nature of how a Mina script runs you can't use scp (unless something like a reverse tunnel is created or something like [zssh's zr command](http://zssh.sourceforge.net/) is used).

On the current patch I'm using [*read*](http://serverfault.com/questions/72476/clean-way-to-write-complex-multi-line-string-to-a-variable) to read text files/content and echo them on the server to a file.

There're two methods:
* *put*, which allows random content to be uploaded to a file, and
* *render*, which renders a template and uploads it to the file (defaults to erb but anything can be used).

Perhaps, if there's a need to upload binary files scp could be used and a parallel connection open?

What do you think? Is this useful?
Thanks,
Darío