Sha256: e9cc94abffb25ac4a9520f53e970698e1e5a62375ec91bce9a7f05083f14d87d

Contents?: true

Size: 817 Bytes

Versions: 43

Compression:

Stored size: 817 Bytes

Contents

module Incline
  class CLI
    class Prepare
      
      private
      
      def install_ruby(shell)
        shell.with_stat("Install Ruby #{@options[:ruby_version]}") do
          result = shell.exec('which rbenv').to_s.strip
          raise 'failed to install rbenv' if result == ''

          shell.exec "rbenv install -v #{@options[:ruby_version]}"
          shell.exec "rbenv global #{@options[:ruby_version]}"

          result = shell.exec('which ruby').to_s.partition("\n")[0].strip
          raise 'ruby not where expected' unless result == shell.home_path + '/.rbenv/shims/ruby' || result == '~/.rbenv/shims/ruby'

          shell.exec "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
          shell.exec 'gem install bundler'
          shell.exec 'rbenv rehash'
        end
      end
      
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
incline-0.3.14 lib/incline/cli/prepare/install_ruby.rb
incline-0.3.13 lib/incline/cli/prepare/install_ruby.rb
incline-0.3.12 lib/incline/cli/prepare/install_ruby.rb
incline-0.3.11 lib/incline/cli/prepare/install_ruby.rb
incline-0.3.10 lib/incline/cli/prepare/install_ruby.rb
incline-0.3.9 lib/incline/cli/prepare/install_ruby.rb
incline-0.3.8 lib/incline/cli/prepare/install_ruby.rb
incline-0.3.7 lib/incline/cli/prepare/install_ruby.rb
incline-0.3.6 lib/incline/cli/prepare/install_ruby.rb
incline-0.3.5 lib/incline/cli/prepare/install_ruby.rb
incline-0.3.4 lib/incline/cli/prepare/install_ruby.rb
incline-0.3.3 lib/incline/cli/prepare/install_ruby.rb
incline-0.3.2 lib/incline/cli/prepare/install_ruby.rb
incline-0.3.1 lib/incline/cli/prepare/install_ruby.rb
incline-0.3.0 lib/incline/cli/prepare/install_ruby.rb
incline-0.2.36 lib/incline/cli/prepare/install_ruby.rb
incline-0.2.35 lib/incline/cli/prepare/install_ruby.rb
incline-0.2.34 lib/incline/cli/prepare/install_ruby.rb
incline-0.2.28 lib/incline/cli/prepare/install_ruby.rb
incline-0.2.27 lib/incline/cli/prepare/install_ruby.rb