Class: EY::Serverside::Propagator

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/engineyard-serverside/propagator.rb

Overview

Propagator ensures that a proper version of the engineyard-serverside gem is installed on a given set of servers

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(servers, shell) ⇒ Propagator

Returns a new instance of Propagator.


21
22
23
24
# File 'lib/engineyard-serverside/propagator.rb', line 21

def initialize(servers, shell)
  @servers = servers
  @shell = shell
end

Instance Attribute Details

#serversObject (readonly)

Returns the value of attribute servers


19
20
21
# File 'lib/engineyard-serverside/propagator.rb', line 19

def servers
  @servers
end

#shellObject (readonly)

Returns the value of attribute shell


19
20
21
# File 'lib/engineyard-serverside/propagator.rb', line 19

def shell
  @shell
end

Class Method Details

.propagate(servers, shell) ⇒ Object


10
11
12
# File 'lib/engineyard-serverside/propagator.rb', line 10

def self.propagate(servers, shell)
  new(servers, shell).propagate
end

Instance Method Details

#propagateObject


26
27
28
29
30
31
32
# File 'lib/engineyard-serverside/propagator.rb', line 26

def propagate
  shell.status "Verifying and propagating #{name_with_version} to all servers."

  servers.remote.run_for_each! do |server|
    propagation_command_for(server)
  end
end