Sha256: f04b0c226748df5cfe9075605008f8f3cccc57ea58db9eaf6c72401a4a7a19d3

Contents?: true

Size: 1.21 KB

Versions: 2

Compression:

Stored size: 1.21 KB

Contents

module DevenvBuild
  module Provisioning
    class Ruby < Base
      def help
        'Install Ruby (with rbenv).'
      end

      def before
        <<-BEFORE
execute_with_rbenv () {
    `cat >$HOME/temp-script.sh <<\\EOF
export HOME=$HOME
if [ -d $HOME/.rbenv ]; then
  export PATH=\"$HOME/.rbenv/bin:$PATH\"
  eval \"$(rbenv init -)\"
fi

EOF
`
    echo $1 >> $HOME/temp-script.sh
    chmod +x $HOME/temp-script.sh
    su $USER -c \"bash -c $HOME/temp-script.sh\"
    rm $HOME/temp-script.sh
}
BEFORE
      end

      def middle
        <<-MIDDLE
`cat >$HOME/install_rbenv.sh <<\\EOF
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH=\"$HOME/.rbenv/bin:$PATH\"' >> ~/.bash_profile
echo 'eval \"$(rbenv init -)\"' >> ~/.bash_profile
EOF
`
chmod +x $HOME/install_rbenv.sh
su $USER -c \"bash -c $HOME/install_rbenv.sh\"
rm $HOME/install_rbenv.sh

sudo apt-get -y install zlib1g-dev libssl-dev libreadline-dev libyaml-dev libsqlite3-dev \\
                        sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev libffi-dev

execute_with_rbenv \"rbenv install 2.4.2 ; rbenv global 2.4.2\"
MIDDLE
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devenv_build-1.1.1 lib/devenv_build/provisioning/ruby.rb
devenv_build-1.1.0 lib/devenv_build/provisioning/ruby.rb