Add support for python and ruby local hooks

This commit is contained in:
Thierry Deo 2017-02-13 14:37:03 +01:00
parent e5669ca135
commit 377cffbd27
12 changed files with 54 additions and 11 deletions

View file

@ -100,6 +100,7 @@ def install_environment(
repo_cmd_runner,
version='default',
additional_dependencies=(),
is_local_hook = False,
): # pragma: windows no cover
additional_dependencies = tuple(additional_dependencies)
directory = helpers.environment_dir(ENVIRONMENT_DIR, version)
@ -115,15 +116,18 @@ def install_environment(
_install_ruby(repo_cmd_runner, version)
# Need to call this after installing to set up the shims
helpers.run_setup_cmd(repo_cmd_runner, ('rbenv', 'rehash'))
helpers.run_setup_cmd(
repo_cmd_runner,
('gem', 'build') + repo_cmd_runner.star('.gemspec'),
)
if not is_local_hook:
helpers.run_setup_cmd(
repo_cmd_runner,
('gem', 'build') + repo_cmd_runner.star('.gemspec'),
)
to_install = () if is_local_hook else repo_cmd_runner.star('.gem')
to_install += additional_dependencies
helpers.run_setup_cmd(
repo_cmd_runner,
(
('gem', 'install', '--no-ri', '--no-rdoc') +
repo_cmd_runner.star('.gem') + additional_dependencies
to_install
),
)