def gemset_present(name, ruby='default', user=None):
 ret = {'name': name, 'result': None, 'comment': '', 'changes': {}}
 ret = _check_rvm(ret, user)
 if (ret['result'] is False):
  return ret
 if ('@' in name):
  (ruby, name) = name.split('@')
  ret = _check_ruby(ret, ruby)
  if (not ret['result']):
   ret['result'] = False
   ret['comment'] = 'Requested ruby implementation was not found.'
   return ret
 if (name in __salt__['rvm.gemset_list'](ruby, runas=user)):
  ret['result'] = True
  ret['comment'] = 'Gemset already exists.'
 else:
  if __opts__['test']:
   ret['result'] = None
   ret['comment'] = 'Set to install gemset {0}'.format(name)
   return ret
  if __salt__['rvm.gemset_create'](ruby, name, runas=user):
   ret['result'] = True
   ret['comment'] = 'Gemset successfully created.'
   ret['changes'][name] = 'created'
  else:
   ret['result'] = False
   ret['comment'] = 'Gemset could not be created.'
 return ret

def gemset_present ( name , ruby = 'default' , user = None ) : ret = { 'name' : name , 'result' : None , 'comment' : '' , 'changes' : { } } ret = _check_rvm ( ret , user ) if ( ret [ 'result' ] is False ) : return ret if ( '@' in name ) : ( ruby , name ) = name . split ( '@' ) ret = _check_ruby ( ret , ruby ) if ( not ret [ 'result' ] ) : ret [ 'result' ] = False ret [ 'comment' ] = 'Requested ruby implementation was not found.' return ret if ( name in __salt__ [ 'rvm.gemset_list' ] ( ruby , runas = user ) ) : ret [ 'result' ] = True ret [ 'comment' ] = 'Gemset already exists.' else : if __opts__ [ 'test' ] : ret [ 'result' ] = None ret [ 'comment' ] = 'Set to install gemset {0}' . format ( name ) return ret if __salt__ [ 'rvm.gemset_create' ] ( ruby , name , runas = user ) : ret [ 'result' ] = True ret [ 'comment' ] = 'Gemset successfully created.' ret [ 'changes' ] [ name ] = 'created' else : ret [ 'result' ] = False ret [ 'comment' ] = 'Gemset could not be created.' return ret
verify that the gemset is present .