Class: MultiRubyRunner::VersionManager::Rbenv
- Inherits:
-
MultiRubyRunner::VersionManager
- Object
- MultiRubyRunner::VersionManager
- MultiRubyRunner::VersionManager::Rbenv
- Defined in:
- lib/multi_ruby_runner/version_manager/rbenv.rb
Overview
Represents the [rbenv](github.com/rbenv/rbenv) ruby version manager.
Instance Method Summary collapse
-
#compute_process_args(command_string, directory, options) ⇒ Hash
See MultiRubyRunner#execute_command_in_directory.
Methods inherited from MultiRubyRunner::VersionManager
Constructor Details
This class inherits a constructor from MultiRubyRunner::VersionManager
Instance Method Details
#compute_process_args(command_string, directory, options) ⇒ Hash
See MultiRubyRunner#execute_command_in_directory
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/multi_ruby_runner/version_manager/rbenv.rb', line 15 def compute_process_args(command_string, directory, ) shell_command_string = [ "cd #{ directory }", # cd into the directory containing .ruby-version file %(eval "$(rbenv init -)"), # let rbenv update the environment (particularly PATH) command_string, # execute command ].join('; ') # For rbenv we just have to reset RBENV_VERSION and override RBENV_DIR # to get the ruby environment specified in `.ruby-version` in directory. { entire_command: [ [:shell_invocation], shell_command_string, ].join(' '), blocking: [:blocking], environment_overrides: { 'RBENV_VERSION' => nil, 'RBENV_DIR' => directory, }, } end |