Sha256: c4b0b6bef281496ebfab641c641224915d26f04e674f36918ecf5052bea3ec03

Contents?: true

Size: 1.24 KB

Versions: 4

Compression:

Stored size: 1.24 KB

Contents

######################################################################
#                             RVM TASKS                              #
######################################################################
module ChickenSoup
  def run_with_ruby_manager(ruby_env_string, command, options = {})
    run "rvm use #{ruby_env_string} && #{command}", options
  end
end

Capistrano::Configuration.instance(:must_exist).load do
  run_task 'ruby:update', :as => manager_username

  namespace :ruby do
    desc <<-DESC
      During the deployment, the wrapper ruby executable used by the
      application server will be switched to utilize the ruby sepecified
      by the application.

      Note: This is only available during a subzero deployment since the web
      server will need to be restarted in order for the changes to take effect.
    DESC
    task :update do
      if ruby_version_update_pending
        after   'ruby:update',    'gems:clean', 'gems:install'

        set     :ruby_version_update_pending,   false

        run("rvm use --create #{full_ruby_environment_string}")
        run("rvm wrapper #{full_ruby_environment_string} #{application_server_type}")
      else
        set     :ruby_version_update_pending,   true
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
chicken_soup-0.8.3 lib/chicken_soup/capabilities/rvm/rvm-tasks.rb
chicken_soup-0.8.2 lib/chicken_soup/capabilities/rvm/rvm-tasks.rb
chicken_soup-0.8.1 lib/chicken_soup/capabilities/rvm/rvm-tasks.rb
chicken_soup-0.8.0 lib/chicken_soup/capabilities/rvm/rvm-tasks.rb