Sha256: 283d280a231b206bcd492dbf81c7c8ca02430f2d8bc277fecdf97d72ed33e72a

Contents?: true

Size: 793 Bytes

Versions: 4

Compression:

Stored size: 793 Bytes

Contents

class MultiRubyRunner

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

    # Detects if and which ruby version manager is present.
    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

    # Instantiates a new VersionManager.
    # @param ruby_path [String] path to ruby executable, as returned by `which ruby`
    def initialize(ruby_executable_path)
      @ruby_executable_path = ruby_executable_path
    end

    def compute_process_args(command_string, directory, options)
      raise "Implement #compute_process_args in subclasses!"
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
multi_ruby_runner-1.0.4 lib/multi_ruby_runner/version_manager.rb
multi_ruby_runner-1.0.3 lib/multi_ruby_runner/version_manager.rb
multi_ruby_runner-1.0.2 lib/multi_ruby_runner/version_manager.rb
multi_ruby_runner-1.0.1 lib/multi_ruby_runner/version_manager.rb