Class: Capistrano::Configuration::Servers
- Inherits:
-
Object
- Object
- Capistrano::Configuration::Servers
- Includes:
- Enumerable
- Defined in:
- lib/capistrano/configuration/servers.rb
Instance Method Summary collapse
- #add_host(host, properties = {}) ⇒ Object
- #add_role(role, hosts, options = {}) ⇒ Object
- #each ⇒ Object
- #fetch_primary(role) ⇒ Object
- #roles_for(names) ⇒ Object
Instance Method Details
#add_host(host, properties = {}) ⇒ Object
10 11 12 |
# File 'lib/capistrano/configuration/servers.rb', line 10 def add_host(host, properties={}) servers.add server(host).with(properties) end |
#add_role(role, hosts, options = {}) ⇒ Object
14 15 16 17 |
# File 'lib/capistrano/configuration/servers.rb', line 14 def add_role(role, hosts, ={}) = Marshal.dump(.merge(roles: role)) Array(hosts).each { |host| add_host(host, Marshal.load()) } end |
#each ⇒ Object
30 31 32 |
# File 'lib/capistrano/configuration/servers.rb', line 30 def each servers.each { |server| yield server } end |