Class: Kcu::ExecShell

Inherits:
Object
  • Object
show all
Defined in:
lib/kcu/services/exec_shell.rb

Class Method Summary collapse

Class Method Details

.call(*args) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/kcu/services/exec_shell.rb', line 4

def self.call(*args)
  command_parts = []
  args.each do |arg|
    if arg.is_a?(Hash)
      arg.each do |key, value|
        command_parts << [key, value].join("=")
      end
    else
      command_parts << arg
    end
  end

  command = command_parts.join(" ")

  Open3.capture3(command)
end