66from pre_commit .languages import helpers
77from pre_commit .prefixed_command_runner import CalledProcessError
88from pre_commit .util import clean_path_on_failure
9+ from pre_commit .util import resource_filename
10+ from pre_commit .util import tarfile_open
911
1012
1113ENVIRONMENT_DIR = 'rbenv'
@@ -23,22 +25,18 @@ def in_env(repo_cmd_runner):
2325
2426
2527def _install_rbenv (repo_cmd_runner , version = 'default' ):
26- repo_cmd_runner .run ([
27- 'git' , 'clone' , 'git://github.com/sstephenson/rbenv' , '{prefix}rbenv' ,
28- ])
28+ with tarfile_open (resource_filename ('rbenv.tar.gz' )) as tf :
29+ tf .extractall (repo_cmd_runner .path ('.' ))
2930
3031 # Only install ruby-build if the version is specified
3132 if version != 'default' :
3233 # ruby-download
33- repo_cmd_runner .run ([
34- 'git' , 'clone' , 'git://github.com/garnieretienne/rvm-download' ,
35- '{prefix}rbenv/plugins/ruby-download' ,
36- ])
34+ with tarfile_open (resource_filename ('ruby-download.tar.gz' )) as tf :
35+ tf .extractall (repo_cmd_runner .path ('rbenv' , 'plugins' ))
36+
3737 # ruby-build
38- repo_cmd_runner .run ([
39- 'git' , 'clone' , 'git://github.com/sstephenson/ruby-build' ,
40- '{prefix}rbenv/plugins/ruby-build' ,
41- ])
38+ with tarfile_open (resource_filename ('ruby-build.tar.gz' )) as tf :
39+ tf .extractall (repo_cmd_runner .path ('rbenv' , 'plugins' ))
4240
4341 activate_path = repo_cmd_runner .path ('rbenv' , 'bin' , 'activate' )
4442 with io .open (activate_path , 'w' ) as activate_file :
0 commit comments