rubber/rubber — pull request #288 by johnnyshields (2013-02-19 12:22:43+00:00)
Title: Support for deploying from a local Windows machine (squashed commits)

I've added the ability to run Rubber from a local Windows machine.

This is acheived by the following modifications:

1. Rubber Code (local): Adding function to BoundEnv to detect local OS
2. Rubber Code (local): Modification of local hosts file writing/cleanup routines
3. Adding local_windows vulcanizer which does 3 things:
* Includes package 'dos2unix' (all roles)
* Adds copying exclusion of Gemfile.lock to remote (due to cross-platform limitation in Bundler)
* Runs on remote 'dos2unix' after copying code to remote (if remote is not Windows)
4. Rubber Code (remote config): Added dos2unix call during config step.

**Known Issues**

Currently I'm ALWAYS running dos2unix on remote configure step, since I can't (easily) figure out a way to tell the remote that I'm running Windows locally. I believe this will harmlessly fail and be skipped if dos2unix isn't installed. **PLEASE REVIEW AND VERIFY THIS**

One possibly better implementation might be to locally run an equivalent of dos2unix on the payloads (code and config files) BEFORE the transfer to the remote. I investigating doing this, but seems Capistrano doesn't support easy hooks to implement it, so we'd have to monkey patch on Capistrano. I will raise a feature request with Capistrano

**Future enhancements**

* When doing any vulcanize calls, Rubber should check if the local env is Windows, and if so prompt user to run the Windows vulcanizer automatically.

* I also have a Wiki section on Windows if/when you accept this pull request