%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/modules/gem.pyo

�
���^c
@@srdZddlmZmZmZddlZddlZddlZddl	Zddl
mZidd6Zej
e�Zdddd�Zddddeeeddd�	Zdddd	�Zdddd
�Zddddd�Zdddd
�Zdddd�Zddddd�Zdddd�Zdddd�Zdddd�Zdddd�ZdS(u
Manage ruby gems.
i(tabsolute_importtunicode_literalstprint_functionN(tCommandExecutionErrorulistulist_cC@s�|p	dg|}|dkr�tdd|�rItd||d|�Stjjj�r�tdd|�r�|dkr�td|d|�Std||d|�Sq�ntd|d|d	t�}|d
dkr�|dSt|d
��dS(uI
    Run the actual gem command. If rvm or rbenv is installed, run the command
    using the corresponding module. rbenv is not available on windows, so don't
    try.

    :param command: string
    Command to run
    :param ruby: string : None
    If RVM or rbenv are installed, the ruby version and gemset to use.
    Ignored if ``gem_bin`` is specified.
    :param runas: string : None
    The user to run gem as.
    :param gem_bin: string : None
    Full path to the ``gem`` binary

    :return:
    Returns the full standard out including success codes or False if it fails
    ugemurvm.is_installedtrunasurvm.dourbenv.is_installedurbenv.dourbenv.do_with_rubyucmd.run_alltpython_shelluretcodeiustdoutustderrN(tNonet__salt__tsalttutilstplatformt
is_windowstFalseR(tcommandtrubyRtgem_bintcmdlinetret((s4/usr/lib/python2.7/site-packages/salt/modules/gem.pyt_gems

c
C@s6y|j�}Wntk
r#nXg}
|rF|
jd|g�ntd|d|d|�r�|so|r|
jd�n|r�|
jd�q�nB|s�|
jd�n|s�|
jd�n|r�|
jd	�n|r�|
jd
|g�n|	r|
jd|	g�ntdg||
|d|d|�S(
u�
    Installs one or several gems.

    :param gems: string
        The gems to install
    :param gem_bin: string : None
        Full path to ``gem`` binary to use.
    :param ruby: string : None
        If RVM or rbenv are installed, the ruby version and gemset to use.
        Ignored if ``gem_bin`` is specified.
    :param runas: string : None
        The user to run gem as.
    :param version: string : None
        Specify the version to install for the gem.
        Doesn't play nice with multiple gems at once
    :param rdoc: boolean : False
        Generate RDoc documentation for the gem(s).
        For rubygems > 3 this is interpreted as the --no-document arg and the
        ri option will then be ignored
    :param ri: boolean : False
        Generate RI documentation for the gem(s).
        For rubygems > 3 this is interpreted as the --no-document arg and the
        rdoc option will then be ignored
    :param pre_releases: boolean : False
        Include pre-releases in the available versions
    :param proxy: string : None
        Use the specified HTTP proxy server for all outgoing traffic.
        Format: http://hostname[:port]

    source : None
        Use the specified HTTP gem source server to download gem.
        Format: http://hostname[:port]

    CLI Example:

    .. code-block:: bash

        salt '*' gem.install vagrant

        salt '*' gem.install redphone gem_bin=/opt/sensu/embedded/bin/gem
    u	--versionRRRu
--no-documentu--prereleaseu	--no-rdocu--no-riu--preu-pu--sourceuinstall(tsplittAttributeErrortextendt_has_rubygems_3tappendR(tgemsRRRtversiontrdoctritpre_releasestproxytsourcetoptions((s4/usr/lib/python2.7/site-packages/salt/modules/gem.pytinstallCs43
cC@sNy|j�}Wntk
r#nXtdg|ddg|d|d|�S(u�
    Uninstall one or several gems.

    :param gems: string
        The gems to uninstall.
    :param gem_bin: string : None
        Full path to ``gem`` binary to use.
    :param ruby: string : None
        If RVM or rbenv are installed, the ruby version and gemset to use.
        Ignored if ``gem_bin`` is specified.
    :param runas: string : None
        The user to run gem as.

    CLI Example:

    .. code-block:: bash

        salt '*' gem.uninstall vagrant
    u	uninstallu-au-xRR(RRR(RRRR((s4/usr/lib/python2.7/site-packages/salt/modules/gem.pyt	uninstall�s
cC@sDy|j�}Wntk
r#nXtdg||d|d|�S(u�
    Update one or several gems.

    :param gems: string
        The gems to update.
    :param gem_bin: string : None
        Full path to ``gem`` binary to use.
    :param ruby: string : None
        If RVM or rbenv are installed, the ruby version and gemset to use.
        Ignored if ``gem_bin`` is specified.
    :param runas: string : None
        The user to run gem as.

    CLI Example:

    .. code-block:: bash

        salt '*' gem.update vagrant
    uupdateRR(RRR(RRRR((s4/usr/lib/python2.7/site-packages/salt/modules/gem.pytupdate�s

ucC@s"tdd|g|d|d|�S(u�
    Update rubygems.

    :param version: string : (newest)
        The version of rubygems to install.
    :param gem_bin: string : None
        Full path to ``gem`` binary to use.
    :param ruby: string : None
        If RVM or rbenv are installed, the ruby version and gemset to use.
        Ignored if ``gem_bin`` is specified.
    :param runas: string : None
        The user to run gem as.

    CLI Example:

    .. code-block:: bash

        salt '*' gem.update_system
    uupdateu--systemRR(R(RRRR((s4/usr/lib/python2.7/site-packages/salt/modules/gem.pyt
update_system�scC@ssdg}t||d|d|�}i}xBtjjj|d�D](}tjd|�}|rC|}PqCqCW|S(u�
    Print out the version of gem

    :param gem_bin: string : None
        Full path to ``gem`` binary to use.
    :param ruby: string : None
        If RVM or rbenv are installed, the ruby version and gemset to use.
        Ignored if ``gem_bin`` is specified.
    :param runas: string : None
        The user to run gem as.

    CLI Example:

    .. code-block:: bash

        salt '*' gem.version
    u	--versionRRu
u[.0-9]+(RRR	t	itertoolsRtretmatch(RRRtcmdtstdoutRtlineR&((s4/usr/lib/python2.7/site-packages/salt/modules/gem.pyR�s		c	C@s5tjdtd|d|d|��}|r1tStS(Nu^3\..*RRR(R%R&RtTrueR(RRRR&((s4/usr/lib/python2.7/site-packages/salt/modules/gem.pyR
s'cC@s�dg}|r|j|�nt||d|d|�}i}xltjjj|d�D]R}tjd|�}|rY|jd�}	|jd�jd�}
|
||	<qYqYW|S(	u�
    List locally installed gems.

    :param prefix: string :
        Only list gems when the name matches this prefix.
    :param gem_bin: string : None
        Full path to ``gem`` binary to use.
    :param ruby: string : None
        If RVM or rbenv are installed, the ruby version and gemset to use.
        Ignored if ``gem_bin`` is specified.
    :param runas: string : None
        The user to run gem as.

    CLI Example:

    .. code-block:: bash

        salt '*' gem.list
    ulistRRu
u^([^ ]+) \((.+)\)iiu, (	RRRR	R$RR%R&tgroup(tprefixRRRR'R(RR)R&tgemtversions((s4/usr/lib/python2.7/site-packages/salt/modules/gem.pytlist_s		c	C@s�tdg|d|d|�}i}xjtjjj|d�D]P}tjd|�}|rp|j�\}}ntj	d|�q=|||<q=W|S(u�
    .. versionadded:: 2015.8.0

    Check if an upgrade is available for installed gems

    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.
    runas : None
        The user to run gem as.

    CLI Example:

    .. code-block:: bash

        salt '*' gem.list_upgrades
    uoutdatedRRu
u(\S+) \(\S+ < (\S+)\)uCan't parse line '%s'(
RRR	R$RR%tsearchtgroupstlogterror(	RRRtresultRR)R&tnameR((s4/usr/lib/python2.7/site-packages/salt/modules/gem.pyt
list_upgrades9s		cC@s"tdd|g|d|d|�S(u�
    Add a gem source.

    :param source_uri: string
        The source URI to add.
    :param gem_bin: string : None
        Full path to ``gem`` binary to use.
    :param ruby: string : None
        If RVM or rbenv are installed, the ruby version and gemset to use.
        Ignored if ``gem_bin`` is specified.
    :param runas: string : None
        The user to run gem as.

    CLI Example:

    .. code-block:: bash

        salt '*' gem.sources_add http://rubygems.org/
    usourcesu--addRR(R(t
source_uriRRR((s4/usr/lib/python2.7/site-packages/salt/modules/gem.pytsources_add_scC@s"tdd|g|d|d|�S(u�
    Remove a gem source.

    :param source_uri: string
        The source URI to remove.
    :param gem_bin: string : None
        Full path to ``gem`` binary to use.
    :param ruby: string : None
        If RVM or rbenv are installed, the ruby version and gemset to use.
        Ignored if ``gem_bin`` is specified.
    :param runas: string : None
        The user to run gem as.

    CLI Example:

    .. code-block:: bash

        salt '*' gem.sources_remove http://rubygems.org/
    usourcesu--removeRR(R(R7RRR((s4/usr/lib/python2.7/site-packages/salt/modules/gem.pytsources_removeyscC@s<tdg|d|d|�}|tkr.gS|j�dS(u�
    List the configured gem sources.

    :param gem_bin: string : None
        Full path to ``gem`` binary to use.
    :param ruby: string : None
        If RVM or rbenv are installed, the ruby version and gemset to use.
        Ignored if ``gem_bin`` is specified.
    :param runas: string : None
        The user to run gem as.

    CLI Example:

    .. code-block:: bash

        salt '*' gem.sources_list
    usourcesRRi(RRt
splitlines(RRRR((s4/usr/lib/python2.7/site-packages/salt/modules/gem.pytsources_list�s(t__doc__t
__future__RRRR%tloggingtsalt.utils.itertoolsRtsalt.utils.platformtsalt.exceptionsRt__func_alias__t	getLoggert__name__R2RRRR R!R"R#RRR/R6R8R9R;(((s4/usr/lib/python2.7/site-packages/salt/modules/gem.pyt<module>s>
-I %$

Zerion Mini Shell 1.0