Remove extraneous newline when adding preamble
Merge pull request #121 from sihil/sihil-fix-preamble-newline

Remove extraneous newline when adding preamble
Add tests to ensure correct behaviour of preamble

 - Ensure that if there if no edits are made that the command detects that
 - Check that the file is untouched
Fix bug that removed newlines at end of file
Handle paths with spaces in them

This doesn't generally matter on Linux systems, but Windows machines are pretty likely to have paths with spaces in them. Quoting the paths prevents this from causing problems.
Handle values of EDITOR with arguments in them

If EDITOR has arguments in it, they need to be separated from the command
proper. This is done here by starting with the full command and chopping
off successive space-separated pieces until an executable path is found.
Work with Ruby 1.8.7

Use each_with_index instead of map.with_index.
Actually work with Ruby 1.8.7

each_with_index alone doesn't work; each_with_index.map does.
Don't double-quote the command

The executable part of the command is already quoted by find_editor.
Allow escaping of ~ in EDITOR
Close the temp file before deleting it

Ruby marks files as open on Windows and attempting to delete one without
closing it first will result in a crash.
Strip preexisting quotes from EDITOR
Fix indentation, improve readability, add comments
Use gsub! instead of gsub
Work on a duplicate of editor if it's frozen
Test for change detection in eyaml edit
Test support for spaces in EDITOR
Unescape spaces in EDITOR since we quote paths
Fix broken tests
Fix unimplemented tests

Apparently Aruba doesn't implement "the stderr should match".