From a7929a2f9e56a5c6e63a8761663f33ce9383f01a Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Tue, 18 Oct 2011 20:38:12 +0200 Subject: [PATCH] Support RMATE_{HOST,PORT}. 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). --- rmate | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rmate b/rmate index 84f0e91..bb0449d 100755 --- a/rmate +++ b/rmate @@ -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 @@ -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