module Vanagon::Utilities::ShellUtilities

Public Instance Methods

andand(*commands) click to toggle source

join a combination of strings and arrays of strings into a single command joined with ‘&&’

@param commands [Array<String, Array<String>>] @return [String]

# File lib/vanagon/utilities/shell_utilities.rb, line 11
def andand(*commands)
  cmdjoin(commands, " && ")
end
andand_multiline(*commands) click to toggle source

join a combination of strings and arrays of strings into a single command joined with ‘&&’ and broken up with newlines after each ‘&&’

@param commands [Array<String, Array<String>>] @return [String]

# File lib/vanagon/utilities/shell_utilities.rb, line 20
def andand_multiline(*commands)
  cmdjoin(commands, " && \\\n")
end
cmdjoin(commands, sep) click to toggle source
# File lib/vanagon/utilities/shell_utilities.rb, line 24
def cmdjoin(commands, sep)
  commands.map { |o| Array(o) }.flatten.join(sep)
end