Method: OodCore::Job::Adapters::Kubernetes::Helper#parse_command

Defined in:
lib/ood_core/job/adapters/kubernetes/helper.rb

#parse_command(cmd) ⇒ Array<#to_s>

Parse a command string given from a user and return an array. If given an array, the input is simply returned back.

Parameters:

  • cmd (#to_s)

    the command to parse

Returns:

  • (Array<#to_s>)

    the command parsed into an array of arguements



77
78
79
80
81
82
83
# File 'lib/ood_core/job/adapters/kubernetes/helper.rb', line 77

def parse_command(cmd)
  if cmd&.is_a?(Array)
    cmd
  else
    Shellwords.split(cmd.to_s)
  end
end