Sha256: 438574c234725036d9f959d23d96d118c1df5d23dd5a756d2fa3cd2a1a9d6871

Contents?: true

Size: 851 Bytes

Versions: 2

Compression:

Stored size: 851 Bytes

Contents

require 'bin_install/ruby_environment_manager/rbenv'
require 'bin_install/ruby_environment_manager/rvm'

module BinInstall
  module RubyEnvironmentManager
    def self.install(version = nil)
      if RubyEnvironmentManager::Rvm.installed?
        puts 'RVM is already installed. Skipping rbenv install.'.blue
        RubyEnvironmentManager::Rvm.install_ruby(version)
        return
      end

      RubyEnvironmentManager::Rbenv.install(version)
    end

    def self.install!(version = nil)
      if RubyEnvironmentManager::Rvm.installed?
        puts 'RVM is already installed. Skipping rbenv install.'.blue
        RubyEnvironmentManager::Rvm.install_ruby!(version)
        return
      end

      RubyEnvironmentManager::Rbenv.install!(version)
    end

    def self.ruby_version
      Dir.chdir(Dir.pwd) { `cat .ruby-version` }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bin_install-0.0.6 lib/bin_install/ruby_environment_manager.rb
bin_install-0.0.5 lib/bin_install/ruby_environment_manager.rb