Sha256: e29c46541fecc3e3f917e99613d374d688bf12bef7e9e341e4017f8527898659

Contents?: true

Size: 1.35 KB

Versions: 19

Compression:

Stored size: 1.35 KB

Contents

# encoding: utf-8
module MagicRecipes
  module Rbenv
    def self.load_into(configuration)
      configuration.load do
        
        # code is taken from railscast #337
        
        set_default :ruby_version, "1.9.3-p125"
        set_default :rbenv_bootstrap, "bootstrap-ubuntu-10-04"

        namespace :rbenv do
          desc "Install rbenv, Ruby, and the Bundler gem"
          task :install, roles: :app do
            run "#{sudo} apt-get -y install curl git-core"
            run "curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash"
            bashrc = <<-BASHRC
        if [ -d $HOME/.rbenv ]; then 
          export PATH="$HOME/.rbenv/bin:$PATH" 
          eval "$(rbenv init -)" 
        fi
        BASHRC
            put bashrc, "/tmp/rbenvrc"
            run "cat /tmp/rbenvrc ~/.bashrc > ~/.bashrc.tmp"
            run "mv ~/.bashrc.tmp ~/.bashrc"
            run %q{export PATH="$HOME/.rbenv/bin:$PATH"}
            run %q{eval "$(rbenv init -)"}
            run "rbenv #{rbenv_bootstrap}"
            run "rbenv install #{ruby_version}"
            run "rbenv global #{ruby_version}"
            run "gem install bundler --no-ri --no-rdoc"
            run "rbenv rehash"
          end
          after "deploy:install", "rbenv:install"
        end
        
        # eof
        
      end
    end
  end
end



        

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
magic_recipes-0.0.19 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.18 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.17 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.16 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.15 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.14 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.13 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.12 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.11 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.10 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.9 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.8 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.7 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.6 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.5 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.4 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.3 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.2 lib/magic_recipes/rbenv.rb
magic_recipes-0.0.1 lib/magic_recipes/rbenv.rb