From 8d1c1129b9411d5f4820d80ea5929c02f0456630 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Mon, 19 Sep 2005 22:15:48 +0000 Subject: [PATCH] Remove trailing newlines from commands to prevent trailing backslash #2141 git-svn-id: http://svn.rubyonrails.org/rails/tools/switchtower@2267 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- CHANGELOG | 2 ++ lib/switchtower/command.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index afe79844..31dd4f5f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Remove trailing newlines from commands to prevent trailing backslash #2141 + * Default parameters work correctly with the generator #2218 [Scott Barron] * Attempt to require 'rubygems' explicitly when running the switchtower utility #2134 diff --git a/lib/switchtower/command.rb b/lib/switchtower/command.rb index 807958fd..2ab6d249 100644 --- a/lib/switchtower/command.rb +++ b/lib/switchtower/command.rb @@ -7,7 +7,7 @@ module SwitchTower def initialize(servers, command, callback, options, actor) #:nodoc: @servers = servers - @command = command.gsub(/\r?\n/, "\\\n") + @command = command.strip.gsub(/\r?\n/, "\\\n") @callback = callback @options = options @actor = actor