%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/rvm.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlZ	ddl
mZddlm
Z
eje�Zidd6Zidd6Zdd	�Zdddd
�Zdddd�Zdd�Zdd
�Zdddd�Zddd�Zdd�Zdd�Zddd�Zdd�Zdd�Zdd�Z ddd�Z!dd�Z"dd�Z#dd�Z$dd�Z%dddd�Z&dS(uK
Manage ruby installations and gemsets with RVM, the Ruby Version Manager.
i(tabsolute_importtunicode_literalstprint_functionN(tCommandExecutionError(tsixulistulist_u	rvm.runascC@sS|rLtjjdj|��}dj|�}tjj|�rL|gSndgS(Nu~{0}u{0}/.rvm/bin/rvmu/usr/local/rvm/bin/rvm(tostpatht
expandusertformattexists(trunast
runas_hometrvmpath((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pyt_get_rvm_locations
c
C@s�|dkrtdd�}nt|�s/tSt|�|}td|d|d|dtd|�}|dd	kr|d
StS(Nu
config.optionu	rvm.runasucmd.run_allR
tcwdtpython_shelltenvuretcodeiustdout(tNonet__salt__tis_installedtFalseR
(tcommandR
RRtcmdtret((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pyt_rvm(s
	c	C@s,t|pddg|d|d|d|�S(NudefaultudoR
RR(R(trubyRR
RR((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pyt_rvm_do;scC@s5ytdt|�d�SWntk
r0tSXdS(us
    Check if RVM is installed.

    CLI Example:

    .. code-block:: bash

        salt '*' rvm.is_installed
    ucmd.has_execiN(RR
t
IndexErrorR(R
((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pyR?s

cC@svd}tddjd|�d|dt�}|ddkrrd	}|d
rc|d|d
7}nt|��ntS(u
    Install RVM system-wide

    runas
        The user under which to run the rvm installer script. If not specified,
        then it be run as the user under which Salt is running.

    CLI Example:

    .. code-block:: bash

        salt '*' rvm.install
    uIhttps://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installerucmd.run_allu%curl -Ls {installer} | bash -s stablet	installerR
Ruretcodeiu5Error encountered while downloading the RVM installerustderru. stderr follows:

(RRtTrueR(R
RRtmsg((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pytinstallOs	
cC@st|dkrg}n|rT|dkrTtdd|g|d|�|jd�ntd|g|d|d|�S(	u
    Install a ruby implementation.

    ruby
        The version of ruby to install

    runas
        The user under which to run rvm. If not specified, then rvm will be run
        as the user under which Salt is running.

    env
        Environment to set for the install command. Useful for exporting compilation
        flags such as RUBY_CONFIGURE_OPTS

    opts
        List of options to pass to the RVM installer (ie -C, --patch, etc)

    CLI Example:

    .. code-block:: bash

        salt '*' rvm.install_ruby 1.9.3-p385
    urootuautolibsudisableR
u--disable-binaryuinstallRN(RRtappend(RR
toptsR((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pytinstall_rubyos	cC@std|gd|d|�S(uD
    Reinstall a ruby implementation

    ruby
        The version of ruby to reinstall

    runas
        The user under which to run rvm. If not specified, then rvm will be run
        as the user under which Salt is running.

    CLI Example:

    .. code-block:: bash

        salt '*' rvm.reinstall_ruby 1.9.3-p385
    u	reinstallR
R(R(RR
R((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pytreinstall_ruby�scC@s�g}tdgd|�}|r�tjd�}xf|j�D]U}|j|�}|r=|j|jd�|jd�|jd�dkg�q=q=Wn|S(u�
    List all rvm-installed rubies

    runas
        The user under which to run rvm. If not specified, then rvm will be run
        as the user under which Salt is running.

    CLI Example:

    .. code-block:: bash

        salt '*' rvm.list
    ulistR
u(^[= ]([*> ]) ([^- ]+)-([^ ]+) \[ (.*) \]iiiu*(Rtretcompilet
splitlinestmatchR tgroup(R
trubiestoutputtregextlineR'((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pytlist_�s;cC@stddd|gd|�S(u8
    Set the default ruby

    ruby
        The version of ruby to make the default

    runas
        The user under which to run rvm. If not specified, then rvm will be run
        as the user under which Salt is running.

    CLI Example:

    .. code-block:: bash

        salt '*' rvm.set_default 2.0.0
    ualiasucreateudefaultR
(R(RR
((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pytset_default�sustablecC@std|gd|�S(u�
    Update RVM

    version : stable
        Which version of RVM to install, (e.g. stable or head)

    CLI Example:

    .. code-block:: bash

        salt '*' rvm.get
    ugetR
(R(tversionR
((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pytget�s
cG@s,d||g}|j|�t|d|�S(um
    Install RVM wrapper scripts

    ruby_string
        Ruby/gemset to install wrappers for

    wrapper_prefix
        What to prepend to the name of the generated wrapper binaries

    runas
        The user under which to run rvm. If not specified, then rvm will be run
        as the user under which Salt is running.

    binaries : None
        The names of the binaries to create wrappers for. When nothing is
        given, wrappers for ruby, gem, rake, irb, rdoc, ri and testrb are
        generated.

    CLI Example:

    .. code-block:: bash

        salt '*' rvm.wrapper <ruby_string> <wrapper_prefix>
    uwrapperR
(textendR(truby_stringtwrapper_prefixR
tbinariesR((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pytwrapper�s
cC@st|d|gd|�S(u�
    Installs a specific rubygems version in the given ruby

    ruby
        The ruby for which to install rubygems

    version
        The version of rubygems to install, or 'remove' to use the version that
        ships with 1.9

    runas
        The user under which to run rvm. If not specified, then rvm will be run
        as the user under which Salt is running.

    CLI Example:

    .. code-block:: bash

        salt '*' rvm.rubygems 2.0.0 1.8.24
    urubygemsR
(R(RR/R
((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pytrubygemsscC@st|ddd|gd|�S(u{
    Creates a gemset.

    ruby
        The ruby version for which to create the gemset

    gemset
        The name of the gemset to create

    runas
        The user under which to run rvm. If not specified, then rvm will be run
        as the user under which Salt is running.

    CLI Example:

    .. code-block:: bash

        salt '*' rvm.gemset_create 2.0.0 foobar
    urvmugemsetucreateR
(R(RtgemsetR
((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pyt
gemset_createsudefaultcC@s�g}t|dddgd|�}|r�tjd�}xE|j�D]4}|j|�}|rF|j|jd��qFqFWn|S(uS
    List all gemsets for the given ruby.

    ruby : default
        The ruby version for which to list the gemsets

    runas
        The user under which to run rvm. If not specified, then rvm will be run
        as the user under which Salt is running.

    CLI Example:

    .. code-block:: bash

        salt '*' rvm.gemset_list
    urvmugemsetulistR
u^   ([^ ]+)i(RR$R%R&R'R R((RR
tgemsetsR*R+R,R'((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pytgemset_list5s cC@s"t|dddd|gd|�S(uj
    Delete a gemset

    ruby
        The ruby version to which the gemset belongs

    gemset
        The gemset to delete

    runas
        The user under which to run rvm. If not specified, then rvm will be run
        as the user under which Salt is running.

    CLI Example:

    .. code-block:: bash

        salt '*' rvm.gemset_delete 2.0.0 foobar
    urvmu--forceugemsetudeleteR
(R(RR7R
((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pyt
gemset_deleteQscC@s"t|dddd|gd|�S(uw
    Remove all gems from a gemset.

    ruby
        The ruby version to which the gemset belongs

    gemset
        The gemset to empty

    runas
        The user under which to run rvm. If not specified, then rvm will be run
        as the user under which Salt is running.

    CLI Example:

    .. code-block:: bash

        salt '*' rvm.gemset_empty 2.0.0 foobar
    urvmu--forceugemsetuemptyR
(R(RR7R
((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pytgemset_emptyjscC@stdd||gd|�S(u�
    Copy all gems from one gemset to another.

    source
        The name of the gemset to copy, complete with ruby version

    destination
        The destination gemset

    runas
        The user under which to run rvm. If not specified, then rvm will be run
        as the user under which Salt is running.

    CLI Example:

    .. code-block:: bash

        salt '*' rvm.gemset_copy foobar bazquo
    ugemsetucopyR
(R(tsourcetdestinationR
((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pytgemset_copy�scC@s�i}d	}tddddgd|�}|r�tjd�}tjd�}xz|j�D]i}|j|�}|r�|jd�}g||<n|j|�}|r[||j|jd��q[q[Wn|S(
uX
    List all gemsets for all installed rubies.

    Note that you must have set a default ruby before this can work.

    runas
        The user under which to run rvm. If not specified, then rvm will be run
        as the user under which Salt is running.

    CLI Example:

    .. code-block:: bash

        salt '*' rvm.gemset_list_all
    udefaulturvmugemsetulist_allR
u^   ([^ ]+)u^gemsets for ([^ ]+)iN(RRR$R%R&R'R(R (R
R9tcurrent_rubyR*t
gems_regextgemset_regexR,R'((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pytgemset_list_all�s
$c	C@sjytjjj|�}Wn/tk
rJtjjjtj|��}nXt||d|d|d|�S(u�
    Execute a command in an RVM controlled environment.

    ruby
        Which ruby to use

    command
        The rvm command to execute

    runas
        The user under which to run rvm. If not specified, then rvm will be run
        as the user under which Salt is running.

    cwd
        The directory from which to run the rvm command. Defaults to the user's
        home directory.

    CLI Example:

    .. code-block:: bash

        salt '*' rvm.do 2.0.0 <command>
    R
RR(tsalttutilstargstshlex_splittAttributeErrorRt	text_typeR(RRR
RR((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pytdo�s

"('t__doc__t
__future__RRRR$Rtloggingtsalt.utils.argsRDtsalt.exceptionsRtsalt.extRt	getLoggert__name__tlogt__func_alias__Rt__opts__R
RRRRR"R#R-R.R0R5R6R8R:R;R<R?RCRJ(((s4/usr/lib/python2.7/site-packages/salt/modules/rvm.pyt<module>s>

	 &!

Zerion Mini Shell 1.0