%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/states/rbenv.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZdd�Zdd�Z	e
dd�Ze
dd�Zdd�Z
dd	�Zdd
�Zdd�ZdS(u�
Managing Ruby installations with rbenv
======================================

This module is used to install and manage ruby installations with rbenv and the
ruby-build plugin. Different versions of ruby can be installed, and uninstalled.
Rbenv will be installed automatically the first time it is needed and can be
updated later. This module will *not* automatically install packages which rbenv
will need to compile the versions of ruby. If your version of ruby fails to
install, refer to the ruby-build documentation to verify you are not missing any
dependencies: https://github.com/sstephenson/ruby-build/wiki

If rbenv is run as the root user then it will be installed to /usr/local/rbenv,
otherwise it will be installed to the users ~/.rbenv directory. To make
rbenv available in the shell you may need to add the rbenv/shims and rbenv/bin
directories to the users PATH. If you are installing as root and want other
users to be able to access rbenv then you will need to add RBENV_ROOT to
their environment.

The following state configuration demonstrates how to install Ruby 1.9.x
and 2.x using rbenv on Ubuntu/Debian:

.. code-block:: yaml

    rbenv-deps:
      pkg.installed:
        - names:
          - bash
          - git
          - openssl
          - libssl-dev
          - make
          - curl
          - autoconf
          - bison
          - build-essential
          - libffi-dev
          - libyaml-dev
          - libreadline6-dev
          - zlib1g-dev
          - libncurses5-dev

    ruby-1.9.3-p429:
      rbenv.absent:
        - require:
          - pkg: rbenv-deps

    ruby-2.0.0-p598:
      rbenv.installed:
        - default: True
        - require:
          - pkg: rbenv-deps
i(tabsolute_importtunicode_literalstprint_functionNcC@s+td|�s't|d<d|d<n|S(u-
    Check to see if rbenv is installed.
    urbenv.is_installeduresultuRbenv is not installed.ucomment(t__salt__tFalse(trettuser((s5/usr/lib/python2.7/site-packages/salt/states/rbenv.pyt_check_rbenv>s

cC@sftdd|�}xLtd|�D]:}||kr$t|d<d|d<||k|d<Pq$q$W|S(u2
    Check to see if given ruby is installed.
    u
rbenv.defaulttrunasurbenv.versionsuresultuRequested ruby existsucommentudefault(RtTrue(RtrubyRtdefaulttversion((s5/usr/lib/python2.7/site-packages/salt/states/rbenv.pyt_ruby_installedHs

cC@s�t||d|�}|dstd|d|�rdt|d<d|d|<d|d<||d	<qt|d<d
|d<|Sn|r�td|d|�n|S(u?
    Verify that ruby is installed, install if unavailable
    Ruresulturbenv.install_rubyRu	InstalleduchangesuSuccessfully installed rubyucommentudefaultuFailed to install rubyu
rbenv.default(R
RR	R(RR
RR((s5/usr/lib/python2.7/site-packages/salt/states/rbenv.pyt_check_and_install_rubyWs





cC@s�i|d6d
d6dd6id6}tj|�}|jd�rXtjdd|�}ntdr�t||d	|�}|ds�d
j|�|d<ndj|�|d<|St	||�}|dt
kr�t
|d<d|d<|St|||d	|�Sd
S(uM
    Verify that the specified ruby is installed with rbenv. Rbenv is
    installed if necessary.

    name
        The version of ruby to install

    default : False
        Whether to make this ruby the default.

    user: None
        The user to run rbenv as.

        .. versionadded:: 0.17.0

    .. versionadded:: 0.16.0
    unameuresultuucommentuchangesuruby-u^ruby-utestRuRuby {0} is set to be installeduRuby {0} is already installeduRbenv failed to installN(tNonetcopytdeepcopyt
startswithtretsubt__opts__R
tformatt_check_and_install_rbenvRR(tnameRRRtrbenv_installed_ret((s5/usr/lib/python2.7/site-packages/salt/states/rbenv.pyt	installedms "



cC@s�t||d|�}|dr�|dr@tddd|�ntd|d|�r|t|d<d|d	|<d
|d<|St|d<d|d<|Snt|d<d
j|�|d<|S(u)
    Verify that ruby is uninstalled
    Ruresultudefaultu
rbenv.defaultusystemRurbenv.uninstall_rubyuUninstalleduchangesuSuccessfully removed rubyucommentuFailed to uninstall rubyuRuby {0} is already absent(R
RR	RR(RR
R((s5/usr/lib/python2.7/site-packages/salt/states/rbenv.pyt_check_and_uninstall_ruby�s






cC@s
i|d6d
d6dd6id6}|jd�rItjdd|�}nt||�}|dtkr�t|d<dj|�|d<|Std	r�t	||d
|�}|dr�d
|d<dj|�|d<nt|d<dj|�|d<|St
||d
|�Sd
S(u
    Verify that the specified ruby is not installed with rbenv. Rbenv
    is installed if necessary.

    name
        The version of ruby to uninstall

    user: None
        The user to run rbenv as.

        .. versionadded:: 0.17.0

    .. versionadded:: 0.16.0
    unameuresultuucommentuchangesuruby-u^ruby-u#Rbenv not installed, {0} not eitherutestRu!Ruby {0} is set to be uninstalleduRuby {0} is already uninstalledN(RRRRRRR	RRR
R(RRR((s5/usr/lib/python2.7/site-packages/salt/states/rbenv.pytabsent�s""




cC@sut||�}|dtkr]td|�rFt|d<d|d<qqt|d<d|d<nt|d<d|d<|S(u@
    Verify that rbenv is installed, install if unavailable
    uresultu
rbenv.installuRbenv installeducommentuRbenv failed to installuRbenv is already installed(RRRR	(RR((s5/usr/lib/python2.7/site-packages/salt/states/rbenv.pyR�s





cC@s�i|d6d
d6dd6id6}tdr}t|d|�}|dtkred
|d<d|d<nt|d<d	|d<|St||�S(u�
    Install rbenv if not installed. Allows you to require rbenv be installed
    prior to installing the plugins. Useful if you want to install rbenv
    plugins via the git or file modules and need them installed before
    installing any rubies.

    Use the rbenv.root configuration option to set the path for rbenv if you
    want a system wide install that is not in a user home dir.

    user: None
        The user to run rbenv as.
    unameuresultuucommentuchangesutestRuRbenv is set to be installeduRbenv is already installedN(RRRRR	R(RRR((s5/usr/lib/python2.7/site-packages/salt/states/rbenv.pyt
install_rbenv�s
"




(t__doc__t
__future__RRRRRRRR
RRRRRRR(((s5/usr/lib/python2.7/site-packages/salt/states/rbenv.pyt<module>6s
)'

Zerion Mini Shell 1.0