This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Refactor the previous commit a little

  • Loading branch information...
jyurek committed Jan 16, 2012
1 parent a2d01c4 commit 0625ac30c4f9dfd5279abcf661852acdb6184709
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/cocaine/command_line.rb
@@ -80,7 +80,11 @@ def interpolation(vars, key)
def shell_quote(string)
return "" if string.nil?
if self.class.unix?
- string.empty? ? "''" : string.split("'").map{|m| "'#{m}'" }.join("\\'")
+ if string.empty?
+ "''"
+ else
+ string.split("'").map{|m| "'#{m}'" }.join("\\'")
+ end
else
%{"#{string}"}
end

1 comment on commit 0625ac3

Owner

mike-burns commented on 0625ac3 Jan 20, 2012

This could probably be made into one larger if ... elsif ... end block.

Please sign in to comment.