Sha256: a63fda00ea70b1920dc8ef5f3378de8e9d0c230b54c1ab335fa96f54fdd6d3f3
Contents?: true
Size: 821 Bytes
Versions: 33
Compression:
Stored size: 821 Bytes
Contents
module SSHKit class Coordinator attr_accessor :hosts def initialize(raw_hosts) @raw_hosts = Array(raw_hosts) @hosts = @raw_hosts.any? ? resolve_hosts : [] end def each(options={}, &block) if hosts options = default_options.merge(options) case options[:in] when :parallel then Runner::Parallel when :sequence then Runner::Sequential when :groups then Runner::Group else options[:in] end.new(hosts, options, &block).execute else Runner::Null.new(hosts, options, &block).execute end end private def default_options SSHKit.config.default_runner_config end def resolve_hosts @raw_hosts.collect { |rh| rh.is_a?(Host) ? rh : Host.new(rh) }.uniq end end end
Version data entries
33 entries across 33 versions & 2 rubygems