MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / get_env_patch

Function get_env_patch

pre_commit/languages/ruby.py:40–72  ·  view source on GitHub ↗
(
        venv: str,
        language_version: str,
)

Source from the content-addressed store, hash-verified

38
39
40def get_env_patch(
41 venv: str,
42 language_version: str,
43) -> PatchesT:
44 patches: PatchesT = (
45 ('GEM_HOME', os.path.join(venv, 'gems')),
46 ('GEM_PATH', UNSET),
47 ('BUNDLE_IGNORE_CONFIG', '1'),
48 )
49 if language_version == 'system':
50 patches += (
51 (
52 'PATH', (
53 os.path.join(venv, 'gems', 'bin'), os.pathsep,
54 Var('PATH'),
55 ),
56 ),
57 )
58 else: # pragma: win32 no cover
59 patches += (
60 ('RBENV_ROOT', venv),
61 (
62 'PATH', (
63 os.path.join(venv, 'gems', 'bin'), os.pathsep,
64 os.path.join(venv, 'shims'), os.pathsep,
65 os.path.join(venv, 'bin'), os.pathsep, Var('PATH'),
66 ),
67 ),
68 )
69 if language_version not in {'system', 'default'}: # pragma: win32 no cover
70 patches += (('RBENV_VERSION', language_version),)
71
72 return patches
73
74
75@contextlib.contextmanager

Callers 1

in_envFunction · 0.70

Calls 1

VarClass · 0.90

Tested by

no test coverage detected