textmate/rmate — pull request #1 by timothyandrew (2012-08-14 18:24:42+00:00)
Title:  rmate --host=auto isn't working

Running `rmate --host=auto` was throwing an error:

```shell
/usr/bin/rmate:124:in `initialize': getaddrinfo: Name or service not known (SocketError) !113
from /usr/bin/rmate:124:in `new'
from /usr/bin/rmate:124:in `connect_and_handle_cmds'
from /usr/bin/rmate:158:in `block in

'
from /usr/bin/rmate:157:in `fork'
from /usr/bin/rmate:157:in `

'
```

The current code that sets the host from $SSH_CONNECTION does so *before* the settings are parsed.

```ruby
if @host == 'auto' and (conn = ENV['SSH_CONNECTION'])
@host = conn.split(' ').first
end

# ...

parse_cli_options
```

`@host` is never `auto` until `parse cli_options` is called. This PR reverses this order.
`--host=auto` seems to work okay now.