class MultiRubyRunner::VersionManager

Abstract class for ruby version managers like rbenv and rvm (or none)

Public Class Methods

detect() click to toggle source

Detects if and which ruby version manager is present.

# 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
new(ruby_executable_path) click to toggle source

Instantiates a new VersionManager. @param ruby_path [String] path to ruby executable, as returned by `which ruby`

# File lib/multi_ruby_runner/version_manager.rb, line 21
def initialize(ruby_executable_path)
  @ruby_executable_path = ruby_executable_path
end

Public Instance Methods

compute_process_args(command_string, directory, options) click to toggle source
# File lib/multi_ruby_runner/version_manager.rb, line 25
def compute_process_args(command_string, directory, options)
  raise "Implement #compute_process_args in subclasses!"
end