def _check_and_install_ruby(ret, ruby, default=False, user=None):
 ret = _check_ruby(ret, ruby, user=user)
 if (not ret['result']):
  if __salt__['rvm.install_ruby'](ruby, runas=user):
   ret['result'] = True
   ret['changes'][ruby] = 'Installed'
   ret['comment'] = 'Successfully installed ruby.'
   ret['default'] = False
  else:
   ret['result'] = False
   ret['comment'] = 'Could not install ruby.'
   return ret
 if default:
  __salt__['rvm.set_default'](ruby, runas=user)
 return ret

def _check_and_install_ruby ( ret , ruby , default = False , user = None ) : ret = _check_ruby ( ret , ruby , user = user ) if ( not ret [ 'result' ] ) : if __salt__ [ 'rvm.install_ruby' ] ( ruby , runas = user ) : ret [ 'result' ] = True ret [ 'changes' ] [ ruby ] = 'Installed' ret [ 'comment' ] = 'Successfully installed ruby.' ret [ 'default' ] = False else : ret [ 'result' ] = False ret [ 'comment' ] = 'Could not install ruby.' return ret if default : __salt__ [ 'rvm.set_default' ] ( ruby , runas = user ) return ret
verify that ruby is installed .