def do_with_ruby(ruby, cmdline, runas=None):
 if (not cmdline):
  raise SaltInvocationError('Command must be specified')
 try:
  cmdline = salt.utils.shlex_split(cmdline)
 except AttributeError:
  cmdline = salt.utils.shlex_split(str(cmdline))
 env = {}
 if ruby:
  env['RBENV_VERSION'] = ruby
  cmd = cmdline
 else:
  cmd = cmdline
 return do(cmd, runas=runas, env=env)

def do_with_ruby ( ruby , cmdline , runas = None ) : if ( not cmdline ) : raise SaltInvocationError ( 'Command must be specified' ) try : cmdline = salt . utils . shlex_split ( cmdline ) except AttributeError : cmdline = salt . utils . shlex_split ( str ( cmdline ) ) env = { } if ruby : env [ 'RBENV_VERSION' ] = ruby cmd = cmdline else : cmd = cmdline return do ( cmd , runas = runas , env = env )
execute a ruby command with rbenvs shims using a specific ruby version cli example: .