Skip to content

Commit

Permalink
Support RMATE_{HOST,PORT}.
Browse files Browse the repository at this point in the history
This allows setting the default host/port as environment variables and additionally, if the server accepts environment variables from the connecting client, solves the problem where multiple clients connects to the same account (e.g. same user on different machines).
  • Loading branch information
sorbits committed Oct 18, 2011
1 parent 49c305b commit a7929a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rmate
Expand Up @@ -3,7 +3,7 @@ require 'optparse'
require 'socket'
require 'fileutils'

VERSION_STRING = 'rmate version 1.2 (2011-01-23)'
VERSION_STRING = 'rmate version 1.3 (2011-10-18)'

class Settings
attr_accessor :host, :port, :wait, :force, :verbose
Expand All @@ -15,6 +15,9 @@ class Settings
@host = conn.split(' ').first
end

@host = ENV['RMATE_HOST'].to_s if ENV.has_key? 'RMATE_HOST'
@port = ENV['RMATE_PORT'].to_i if ENV.has_key? 'RMATE_PORT'

@wait = false
@force = false
@verbose = false
Expand Down

0 comments on commit a7929a2

Please sign in to comment.