Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/clwizard/modules/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/clwizard/modules/__pycache__/ruby.cpython-311.pyc

�

��fg���ddlmZddlZddlmZddlmZmZmZddl	m
Z
ddlmZddl
mZddlmZd	d
lmZGd�de��ZdS)
�)�absolute_importN)�Feature)�ExternalProgramFailed�get_passenger_package_name�is_litespeed_running)�
get_ui_config)�MODULES_LOGS_DIR)�InstallationFailedException)�installed_interpreters_list�)�WizardInstallerc���eZdZej�ed��Zej	Z
�fd�Zd�Zd�Z
d�Zd�Zd�Zed���Z�xZS)	�
RubyInstallerzruby.logc�V��tt|�����dS)N)�superr�__init__)�self�	__class__s ��L/opt/cloudlinux/venv/lib64/python3.11/site-packages/clwizard/modules/ruby.pyrzRubyInstaller.__init__s%���
�m�T�"�"�+�+�-�-�-�-�-�c�$�g}|D]0}d|�dd��z}|�|���1|j�dd�|����	|j|�dS#t$r}t��|�d}~wwxYw)Nzalt-ruby�.�z-Try to install Ruby package with versions: %s�,)�replace�append�
app_logger�info�join�_install_groupsrr
)r�versions�groups�v�package_name�es      r�_install_ruby_versionsz$RubyInstaller._install_ruby_versionss������	(�	(�A�%��	�	�#�r�(:�(:�:�L��M�M�,�'�'�'�'�����L�c�h�h�W_�N`�N`�a�a�a�	7� �D� �&�)�)�)�)��$�	7�	7�	7�-�/�/�Q�6�����	7���s�%
A1�1
B�;B
�
Bc��d}tj�|��sdS	|�d|g��dS#t$r}t��|�d}~wwxYw)a
        In order to make ruby apps work on Litespeed server, we need to run an
        extra script

        See docs for details:
        https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cloudlinux:enable_passenger
        :return:
        z9/usr/local/lsws/admin/misc/enable_ruby_python_selector.shN�sh)�os�path�isfile�_run_commandrr
)r�litespeed_scriptr%s   r�_configure_for_litespeed_serverz-RubyInstaller._configure_for_litespeed_server)s{��W���w�~�~�.�/�/�	��F�	7����t�%5�6�7�7�7�7�7��$�	7�	7�	7�-�/�/�Q�6�����	7���s�>�
A�A�Ac���|�t����}t��p5t���di���d��}|o|S)a�
        Check that the Ruby Selector is ready to work

        All configurations were done and Passenger is installed
        We always have at least one ruby package installed, because it's a
        dependency of the Passenger package, so we can skip that check
        If the config file does not exist, we ignore the uiSettings
        :return: already_configured status
        :rtype: bool
        �
uiSettings�hideRubyApp)�_is_package_installedrr�get)r�passenger_installed�
configs_oks   r�_is_already_configuredz$RubyInstaller._is_already_configured<sb��#�8�8�9S�9U�9U�V�V��&���(�h�
���0C�0C�L�RT�0U�0U�0Y�0Y�Zg�0h�0h�,h�
�"�1�z�1rc���g}td��}|D]#}|jr|�|j���$|���||�d��d�d�S)N�ruby)�installed_versions�available_versions)�already_configured�options)r�	installedr�versionr6�_get_available_versions)r�installed_ruby_versions�interpreters_list�interpreters    r�initial_statuszRubyInstaller.initial_statusKs���"$��7��?�?��,�	D�	D�K��$�
D�'�.�.�{�/B�C�C�C��"&�"=�"=�"?�"?�&=�&*�&B�&B�6�&J�&J���
�
�	
rc�:�|�dg��}|���|�|��t��r|���	|�gd���dS#t$r}t��|�d}~wwxYw)Nr!)zcloudlinux-config�setz--jsonz:--data={"options": {"uiSettings": {"hideRubyApp": false}}})r3�_install_passengerr&rr.r,rr
)rr<�install_versionsr%s    r�run_installationzRubyInstaller.run_installationYs���"�;�;�z�2�6�6�����!�!�!��#�#�$4�5�5�5��!�!�	3��0�0�2�2�2�
	7�������
�
�
�
�
��%�	7�	7�	7�-�/�/�Q�6�����	7���s�#A<�<
B�B�Bc��dhS)Nr!�)�clss r�supported_optionszRubyInstaller.supported_optionsms
���|�r)�__name__�
__module__�__qualname__r)r*rr	�LOG_FILEr�
RUBY_SELECTOR�_REQUIRED_CL_COMPONENT_SUPPORTrr&r.r6rCrH�classmethodrL�
__classcell__)rs@rrrs���������w�|�|�,�j�9�9�H�%,�%:�"�.�.�.�.�.�	7�	7�	7�7�7�7�&
2�
2�
2�
�
�
�7�7�7�(����[�����rr)�
__future__rr)�clcommon.constr�clcommon.utilsrrr�clconfig.ui_config_libr�clwizard.constantsr	�clwizard.exceptionsr
�clwizard.utilsr�baser
rrJrr�<module>r]s���'�&�&�&�&�&�	�	�	�	�"�"�"�"�"�"�b�b�b�b�b�b�b�b�b�b�0�0�0�0�0�0�/�/�/�/�/�/�;�;�;�;�;�;�6�6�6�6�6�6�!�!�!�!�!�!�X�X�X�X�X�O�X�X�X�X�Xr

Hacked By AnonymousFox1.0, Coded By AnonymousFox