serverspec/specinfra — pull request #256 by k0kubun (2014-11-16 14:03:29+00:00)
Title: Strip first newline when sudo

## Problem
When I execute `itamae ssh` by non-root user, all stdout is prefixed by `"\n"`.
Thus a part of itamae's debug output becomes like:

```
DEBUG : Executing `stat -c %a /home/k0kubun/.ssh`...
DEBUG : exited with 0
DEBUG : stdout |
DEBUG : stdout | 700
INFO : mode will change from '
700' to '700'
```

When command is prefixed by `sudo -p 'Password: '` and password is inputted with `send_data`, it seems `"\r\n"` is printed before command's stdout.

## Solution
Trimming the newline if command is prefixed by `sudo -p 'Password: '`.
With this patch, itamae's debug output changed to:

```
DEBUG : Executing `stat -c %a /home/k0kubun/.ssh`...
DEBUG : exited with 0
DEBUG : stdout | 700
DEBUG : mode will not change (current value is '700')
```