Make sure that a gem is not installed.

    name
        The name of the gem to uninstall

    gem_bin : None
        Full path to ``gem`` binary to use.

    ruby : None
        If RVM or rbenv are installed, the ruby version and gemset to use.
        Ignored if ``gem_bin`` is specified.

    user: None
        The user under which to run the ``gem`` command

        .. versionadded:: 0.17.0

def removed(name, ruby=None, user=None, gem_bin=None):
    '''
    Make sure that a gem is not installed.

    name
        The name of the gem to uninstall

    gem_bin : None
        Full path to ``gem`` binary to use.

    ruby : None
        If RVM or rbenv are installed, the ruby version and gemset to use.
        Ignored if ``gem_bin`` is specified.

    user: None
        The user under which to run the ``gem`` command

        .. versionadded:: 0.17.0
    '''
    ret = {'name': name, 'result': None, 'comment': '', 'changes': {}}

    if name not in __salt__['gem.list'](name, ruby, gem_bin=gem_bin, runas=user):
        ret['result'] = True
        ret['comment'] = 'Gem is not installed.'
        return ret

    if __opts__['test']:
        ret['comment'] = 'The gem {0} would have been removed'.format(name)
        return ret
    if __salt__['gem.uninstall'](name, ruby, gem_bin=gem_bin, runas=user):
        ret['result'] = True
        ret['changes'][name] = 'Removed'
        ret['comment'] = 'Gem was successfully removed.'
    else:
        ret['result'] = False
        ret['comment'] = 'Could not remove gem.'
    return ret