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

�
���^c@@s�dZddlmZmZmZddlZdd�Zedddd�Z	dd�Z
edddd�Zddd	�ZdS(
u	
Managing Ruby installations and gemsets with Ruby Version Manager (RVM)
=======================================================================

This module is used to install and manage ruby installations and
gemsets with RVM, the Ruby Version Manager. Different versions of ruby
can be installed and gemsets created. RVM itself will be installed
automatically if it's not present. This module will not automatically
install packages that RVM depends on or ones that are needed to build
ruby. If you want to run RVM as an unprivileged user (recommended) you
will have to create this user yourself. This is how a state
configuration could look like:

.. code-block:: yaml

    rvm:
      group.present: []
      user.present:
        - gid: rvm
        - home: /home/rvm
        - require:
          - group: rvm

    rvm-deps:
      pkg.installed:
        - pkgs:
          - bash
          - coreutils
          - gzip
          - bzip2
          - gawk
          - sed
          - curl
          - git-core
          - subversion

    mri-deps:
      pkg.installed:
        - pkgs:
          - build-essential
          - openssl
          - libreadline6
          - libreadline6-dev
          - curl
          - git-core
          - zlib1g
          - zlib1g-dev
          - libssl-dev
          - libyaml-dev
          - libsqlite3-0
          - libsqlite3-dev
          - sqlite3
          - libxml2-dev
          - libxslt1-dev
          - autoconf
          - libc6-dev
          - libncurses5-dev
          - automake
          - libtool
          - bison
          - subversion
          - ruby

    jruby-deps:
      pkg.installed:
        - pkgs:
          - curl
          - g++
          - openjdk-6-jre-headless

    ruby-1.9.2:
      rvm.installed:
        - default: True
        - user: rvm
        - require:
          - pkg: rvm-deps
          - pkg: mri-deps
          - user: rvm

    jruby:
      rvm.installed:
        - user: rvm
        - require:
          - pkg: rvm-deps
          - pkg: jruby-deps
          - user: rvm

    jgemset:
      rvm.gemset_present:
        - ruby: jruby
        - user: rvm
        - require:
          - rvm: jruby

    mygemset:
      rvm.gemset_present:
        - ruby: ruby-1.9.2
        - user: rvm
        - require:
          - rvm: ruby-1.9.2
i(tabsolute_importtunicode_literalstprint_functionNcC@s+td|�s't|d<d|d<n|S(u+
    Check to see if rvm is installed.
    urvm.is_installeduresultuRVM is not installed.ucomment(t__salt__tFalse(trettuser((s3/usr/lib/python2.7/site-packages/salt/states/rvm.pyt
_check_rvmms

cC@s�t||d|�}|ds�td|d|d|d|�rpt|d<d|d|<d	|d
<t|d<q�t|d<d|d
<|Sn|r�td
|d|�n|S(u?
    Verify that ruby is installed, install if unavailable
    Ruresulturvm.install_rubytrunastoptstenvu	InstalleduchangesuSuccessfully installed ruby.ucommentudefaultuCould not install ruby.urvm.set_default(t_check_rubyRtTrueR(RtrubytdefaultRR	R
((s3/usr/lib/python2.7/site-packages/salt/states/rvm.pyt_check_and_install_rubyws
"




c	C@st}t}tjd�}|j|�r3t}ntjd|�rNt}ntjdd|�}x�tdd|�D]�\}}}|dkr�djd	|d
|�}n|s�|jd|�}n|s�tjdd|�}n||krwt|d<d
|d<||d<PqwqwW|S(u&
    Check that ruby is installed
    u-([0-9]{4}\.[0-9]{2}|p[0-9]+)$u^[a-z]+$u^ruby-uurvm.listRurubyu{impl}-{version}timpltversionu-.*uresultuRequested ruby exists.ucommentudefault(RRtretcompiletsearchtsubRtformat(	RR
Rt
match_versiontmatch_micro_versiontmicro_version_regexRRR((s3/usr/lib/python2.7/site-packages/salt/states/rvm.pyR�s*		#


c
C@s�i|d6dd6dd6id6}tdrCdj|�|d<|St||�}|dtkr�tdd	|�s�d
|d<|St|||d|d|d
|�Sn"t|||d|d|d
|�SdS(u�
    Verify that the specified ruby is installed with RVM. RVM is
    installed when necessary.

    name
        The version of ruby to install

    default : False
        Whether to make this ruby the default.

    user: None
        The user to run rvm as.

    env: None
        A list of environment variables to set (ie, RUBY_CONFIGURE_OPTS)

    opts: None
        A list of option flags to pass to RVM (ie -C, --patch)

        .. versionadded:: 0.17.0
    unameuresultuucommentuchangesutestuRuby {0} is set to be installedurvm.installRuRVM failed to install.RR	R
N(tNonet__opts__RRRRR(tnameRRR	R
R((s3/usr/lib/python2.7/site-packages/salt/states/rvm.pyt	installed�s"

%udefaultcC@sNi|d6dd6dd6id6}t||�}|dtkrE|Sd|kr�|jd�\}}t||�}|ds�t|d<d|d<|Sn|td|d	|�kr�t|d<d
|d<n}tdr�d|d<dj|�|d<|Std
||d	|�r6t|d<d|d<d|d|<nt|d<d|d<|S(u�
    Verify that the gemset is present.

    name
        The name of the gemset.

    ruby: default
        The ruby version this gemset belongs to.

    user: None
        The user to run rvm as.

        .. versionadded:: 0.17.0
    unameuresultuucommentuchangesu@u,Requested ruby implementation was not found.urvm.gemset_listRuGemset already exists.utestuSet to install gemset {0}urvm.gemset_createuGemset successfully created.ucreateduGemset could not be created.N(	RRRtsplitRRRRR(RR
RR((s3/usr/lib/python2.7/site-packages/salt/states/rvm.pytgemset_present�s2"










(
t__doc__t
__future__RRRRRRRRRRR(((s3/usr/lib/python2.7/site-packages/salt/states/rvm.pyt<module>fs
'

Zerion Mini Shell 1.0