Compact whitespace when removing flags

This prevents multiple calls to flag-modifying ENV methods from
resulting in large amounts of consecutive spaces.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel committed 2012-08-23 22:29:56 -05:00
1 parent 672696b086
commit 84a084a083
1 file changed
+1
+1
View File
@@ -409,6 +409,7 @@ Please take one of the following actions:
[*key].each do |key|
next if self[key].nil?
self[key] = self[key].sub value, '' # can't use sub! on ENV
self[key] = self[key].gsub /\s+/, ' ' # compact whitespace
self[key] = nil if self[key].empty? # keep things clean
end
end