Class: SSHKit::Coordinator

Inherits:
Object
  • Object
show all
Defined in:
lib/sshkit/chunky/runner/coordinator.rb

Instance Method Summary collapse

Instance Method Details

#each(options = {}, &block) ⇒ Object

overrides original method to include chunks runner



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/sshkit/chunky/runner/coordinator.rb', line 6

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
    when :chunks   then SSHKit::Chunky::Runner::Chunks # <- added
    else
      options[:in]
    end.new(hosts, options, &block).execute
  else
    Runner::Null.new(hosts, options, &block).execute
  end
end