Sha256: 96387b4520dce248305a8445c235b9d3bdb9819624763d0ff3a7387bb0767afe

Contents?: true

Size: 1002 Bytes

Versions: 40

Compression:

Stored size: 1002 Bytes

Contents

# Recipes for using RVM on a server with capistrano.

unless Capistrano::Configuration.respond_to?(:instance)
  abort "rvm/capistrano requires Capistrano >= 2."
end

Capistrano::Configuration.instance(true).load do

  # Taken from the capistrano code.
  def _cset(name, *args, &block)
    unless exists?(name)
      set(name, *args, &block)
    end
  end

  set :default_shell do
    shell = File.join(rvm_bin_path, "rvm-shell")
    ruby = rvm_ruby_string.to_s.strip
    shell = "#{shell} '#{ruby}'" unless ruby.empty?
    shell
  end

  # Let users set the type of their rvm install.
  _cset(:rvm_type, :system)

  # Let users override the rvm_bin_path
  _cset(:rvm_bin_path) do
    case rvm_type
    when :system_wide, :root, :system
      "/usr/local/bin"
    when :local, :user, :default
      "$HOME/.rvm/bin"
    end
  end

  # Use the default ruby.
  _cset(:rvm_ruby_string, "default")

end

# E.g, to use ree and rails 3:
#
#   require 'rvm/capistrano'
#   set :rvm_ruby_string, "ree@rails3"
#

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
rvm-1.1.3 lib/rvm/capistrano.rb
rvm-1.1.2 lib/rvm/capistrano.rb
rvm-1.1.1 lib/rvm/capistrano.rb
rvm-1.1.0 lib/rvm/capistrano.rb
rvm-1.0.23 lib/rvm/capistrano.rb
rvm-1.0.22 lib/rvm/capistrano.rb
rvm-1.0.21 lib/rvm/capistrano.rb
rvm-1.0.20 lib/rvm/capistrano.rb
rvm-1.0.19 lib/rvm/capistrano.rb
rvm-1.0.18 lib/rvm/capistrano.rb
rvm-1.0.17 lib/rvm/capistrano.rb
rvm-1.0.15 lib/rvm/capistrano.rb
gemrage-1.0.0 vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/capistrano.rb
gemrage-0.4.1 vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/capistrano.rb
gemrage-0.4.0 vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/capistrano.rb
gemrage-0.3.2 vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/capistrano.rb
gemrage-0.3.1 vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/capistrano.rb
gemrage-0.3.0 vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/capistrano.rb
gemrage-0.2.0 vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/capistrano.rb
gemrage-0.1.2 vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/capistrano.rb