lib/j-cap-recipes/rails.rb in j-cap-recipes-0.0.15 vs lib/j-cap-recipes/rails.rb in j-cap-recipes-0.0.16

- old
+ new

@@ -1,45 +1,4 @@ require 'sshkit/backends/ssh_command' -require 'sshkit/runners/abstract' - -#Patch to support backend option -# Sent PR https://github.com/capistrano/sshkit/pull/117, except constantinize -module SSHKit - - module Runner - - class Abstract - - attr_reader :hosts, :options, :block - - def initialize(hosts, options = nil, &block) - @hosts = Array(hosts) - @options = options || {} - @block = block - end - - private - - def backend(host, &block) - backend_factory.new(host, &block) - end - - def backend_factory - case @options[:backend] - when Symbol - SSHKit::Backend.const_get(@options[:backend].to_s.split('_').collect(&:capitalize).join) - when String - Kernel.const_get(@options[:backend]) - when nil - SSHKit.config.backend - else - @options[:backend] - end - - end - end - - end - -end +require_relative 'sshkit_runner_patch' load File.expand_path('../tasks/rails.rake', __FILE__)