관리-도구
편집 파일: ruby.cpython-38.pyc
U ,�e� � @ sr d dl mZ d dlZd dlZd dlZd dlZd dlZd dl Z d dl mZ d dl mZ d dl m Z d dlmZ d dlmZ d dlmZ d dlmZ d d lmZ d d lmZ d dlmZ d dlmZ d ZejZejZ ddd�dd�Z!ej"dd�dd�dd��Z#dddd�dd�Z$ej%dddd�dd ��Z&ddd!d"�d#d$�Z'ddd!d�d%d&�Z(ddd!d�d'd(�Z)ddd)d!d*�d+d,�Z*dS )-� )�annotationsN)� Generator)�IO)�Sequence)� lang_base)� envcontext)�PatchesT)�UNSET)�Var)�Prefix)�CalledProcessError�rbenv�strz IO[bytes])�filename�returnc C s t j�d| �S )Nzpre_commit.resources)� importlib� resources�open_binary)r � r �G/opt/hc_python/lib/python3.8/site-packages/pre_commit/languages/ruby.py�_resource_bytesio s r � )�maxsize)r c C s t dd� dD ��rdS tjS d S )Nc s s | ]}t �|�V qd S �N)r Z exe_exists)�.0�exer r r � <genexpr>! s z&get_default_version.<locals>.<genexpr>)�ruby�gem�system)�all�C�DEFAULTr r r r �get_default_version s r# r )�venv�language_versionr c C s� dt j�| d�fdtfdf}|dkrL|dt j�| dd�t jtd�fff7 }nL|d| fdt j�| dd�t jt j�| d �t jt j�| d�t jtd�fff7 }|d kr�|d|ff7 }|S )NZGEM_HOME�gemsZGEM_PATH)ZBUNDLE_IGNORE_CONFIG�1r �PATH�binZ RBENV_ROOTZshims> �defaultr Z RBENV_VERSION)�os�path�joinr �pathsepr )r$ r% Zpatchesr r r � get_env_patch'