Normally, brew installations do not require sudo. There might be
certain cases where it does, so this commit preserves the old behaviour
where ownership of the brew script isn't the same as the user executing
ruby-install. Otherwise, sudo is omitted.
This also solves #128 for situations where the issue was caused by sudo
not preserving the user's environment (proxy failures could also be
caused by a host of other reasons, but it's the main reason why the issue was created originally).
Normally, brew installations do not require sudo. There might be certain cases where it does, so this commit preserves the old behaviour where ownership of the brew script isn't the same as the user executing ruby-install. Otherwise, sudo is omitted.
This also solves #128 for situations where the issue was caused by sudo not preserving the user's environment (proxy failures could also be caused by a host of other reasons, but it's the main reason why the issue was created originally).