redding/scmd — pull request #24 by jcredding (2014-06-12 15:52:11+00:00)
Title: Allow passing an env var hash to commands

This updates the `Command` class to take a hash for passing env
variables. These are passed to the `popen4` call and are set as
environment variables for the child process. This allows passing
sensitive env vars like passwords without putting them in the
command string.

@kellyredding - This came about with trying to add SQL schema dumping to ardb. I wanted to use scmd to run the commands but I need to set environment variables using the database configuration. One of these is the password and I didn't want to put that in the command string directly. I checked with [posix-spawn and they allowed passing an environment variable hash](https://github.com/rtomayko/posix-spawn/blob/master/lib/posix/spawn.rb#L46) so I wanted to allow using that with scmd. I chose to put the env var hash as the last argument instead of how they have it as an optional first argument.