Sha256: 6d8e759ecec48516a04ba00bdd7b08950b8f29f98ac33872916ba10582cadd85

Contents?: true

Size: 882 Bytes

Versions: 10

Compression:

Stored size: 882 Bytes

Contents

require 'rvm/capistrano/base'
require 'rvm/capistrano/helpers/quote_and_escape'

rvm_with_capistrano do

  if fetch(:rvm_require_role,nil).nil?
    raise "

ERROR: no 'set :rvm_require_role, \"...\"' declared before 'rvm/capistrano/selector_mixed',
       it is required for proper functioning, please add it and try again.

"
  end

  # conflicts with rvm/capistrano/selector
  class << self
    def run(cmd, options={}, &block)
      if options[:eof].nil? && !cmd.include?(sudo)
        options = options.merge(:eof => !block_given?)
      end
      shell = options[:shell]
      options[:shell] = false

      parallel(options) do |session|
        if shell.nil?
          session.when "in?(:#{fetch(:rvm_require_role,nil)})", command_with_shell(cmd, fetch(:rvm_shell)), &block
        end
        session.else command_with_shell(cmd, shell), &block
      end
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rvm-capistrano-1.5.6 lib/rvm/capistrano/selector_mixed.rb
rvm-capistrano-1.5.5 lib/rvm/capistrano/selector_mixed.rb
rvm-capistrano-1.5.4 lib/rvm/capistrano/selector_mixed.rb
rvm-capistrano-1.5.3 lib/rvm/capistrano/selector_mixed.rb
rvm-capistrano-1.5.2 lib/rvm/capistrano/selector_mixed.rb
rvm-capistrano-1.5.1 lib/rvm/capistrano/selector_mixed.rb
rvm-capistrano-1.5.0 lib/rvm/capistrano/selector_mixed.rb
rvm-capistrano-1.5.0.rc1 lib/rvm/capistrano/selector_mixed.rb
rvm-capistrano-1.4.4 lib/rvm/capistrano/selector_mixed.rb
rvm-capistrano-1.4.3 lib/rvm/capistrano/selector_mixed.rb