Class: MultiRubyRunner::VersionManager
- Inherits:
-
Object
- Object
- MultiRubyRunner::VersionManager
- Defined in:
- lib/multi_ruby_runner/version_manager.rb,
lib/multi_ruby_runner/version_manager/rvm.rb,
lib/multi_ruby_runner/version_manager/none.rb,
lib/multi_ruby_runner/version_manager/rbenv.rb
Overview
Abstract class for ruby version managers like rbenv and rvm (or none)
Defined Under Namespace
Class Method Summary collapse
-
.detect ⇒ Object
Detects if and which ruby version manager is present.
Instance Method Summary collapse
- #compute_process_args(command_string, directory, options) ⇒ Object
-
#initialize(ruby_executable_path) ⇒ VersionManager
constructor
Instantiates a new VersionManager.
Constructor Details
#initialize(ruby_executable_path) ⇒ VersionManager
Instantiates a new VersionManager.
21 22 23 |
# File 'lib/multi_ruby_runner/version_manager.rb', line 21 def initialize(ruby_executable_path) @ruby_executable_path = ruby_executable_path end |
Class Method Details
.detect ⇒ Object
Detects if and which ruby version manager is present.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/multi_ruby_runner/version_manager.rb', line 7 def self.detect which_ruby = `which ruby` case which_ruby when /\/\.rbenv\// Rbenv.new(which_ruby) when /\/\.rvm\// Rvm.new(which_ruby) else None.new(which_ruby) end end |
Instance Method Details
#compute_process_args(command_string, directory, options) ⇒ Object
25 26 27 |
# File 'lib/multi_ruby_runner/version_manager.rb', line 25 def compute_process_args(command_string, directory, ) raise "Implement #compute_process_args in subclasses!" end |