Sha256: 65fc278863bd78c3b1ed9377482045d98199f80ae152e9ba6f01112a0bc5b8ff

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

module BinInstall
  module RubyEnvironmentManager
    module Rbevn
      def self.install(version = nil)
        puts 'Installing rbenv...'.white
        Brew.install_or_upgrade('rbenv')
        Brew.install_or_upgrade('ruby-build')
        install_ruby(version)
      end

      def self.install!(version = nil)
        puts 'Installing rbenv...'.white
        Brew.install_or_upgrade!('rbenv')
        Brew.install_or_upgrade!('ruby-build')
        install_ruby!(version)
      end

      def self.install_ruby(version = nil)
        version ||= RubyEnvironmentManager.ruby_version

        if version
          system("rbenv install #{version}")
        else
          puts 'Unknown Ruby version. Create `.ruby-version` file.'
        end
      end

      def self.install_ruby!(version = nil)
        version ||= RubyEnvironmentManager.ruby_version

        if version
          BinInstall.system!("rbenv install #{version}")
        else
          abort('Unknown Ruby version. Create `.ruby-version` file.')
        end
      end

      def self.installed?
        system('rbenv --version')
      end
    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/rbenv.rb
bin_install-0.0.5 lib/bin_install/ruby_environment_manager/rbenv.rb