Class: DeployConfig
- Inherits:
-
Object
- Object
- DeployConfig
- Defined in:
- lib/xnlogic/server_profile.rb
Overview
Captures Capistrano-relevant configuration from a server profile.
Class Attribute Summary collapse
-
.roles ⇒ Object
readonly
Returns the value of attribute roles.
-
.variables ⇒ Object
readonly
Returns the value of attribute variables.
Class Method Summary collapse
- .api_hostname(hn) ⇒ Object
-
.apply_cap_config(config_binding) ⇒ Object
config_binding is the binding taken from the Capistrano configuration file.
- .configure(&config_block) ⇒ Object
-
.hostname(hn) ⇒ Object
Setters.
- .method_missing(symbol, *args) ⇒ Object
- .nginx_conf(file_path) ⇒ Object
- .ssl_cert(cert_path) ⇒ Object
- .user(u) ⇒ Object
Class Attribute Details
.roles ⇒ Object (readonly)
Returns the value of attribute roles.
4 5 6 |
# File 'lib/xnlogic/server_profile.rb', line 4 def roles @roles end |
.variables ⇒ Object (readonly)
Returns the value of attribute variables.
4 5 6 |
# File 'lib/xnlogic/server_profile.rb', line 4 def variables @variables end |
Class Method Details
.api_hostname(hn) ⇒ Object
28 29 30 |
# File 'lib/xnlogic/server_profile.rb', line 28 def api_hostname(hn) @variables[:api_hostname] = hn end |
.apply_cap_config(config_binding) ⇒ Object
config_binding is the binding taken from the Capistrano configuration file
13 14 15 16 17 18 19 20 |
# File 'lib/xnlogic/server_profile.rb', line 13 def apply_cap_config(config_binding) roles.each do |role, user| config_binding.eval("role #{role.inspect}, #{user.inspect}") end variables.each do |name, val| config_binding.eval("set #{name.inspect}, #{val.inspect}") end end |
.configure(&config_block) ⇒ Object
6 7 8 9 10 |
# File 'lib/xnlogic/server_profile.rb', line 6 def configure(&config_block) @roles = {} @variables = {} instance_eval &config_block end |
.hostname(hn) ⇒ Object
Setters
24 25 26 |
# File 'lib/xnlogic/server_profile.rb', line 24 def hostname(hn) @roles[:web] = hn end |
.method_missing(symbol, *args) ⇒ Object
44 45 46 |
# File 'lib/xnlogic/server_profile.rb', line 44 def method_missing(symbol, *args) # Swallow config settings we don't care about end |
.nginx_conf(file_path) ⇒ Object
40 41 42 |
# File 'lib/xnlogic/server_profile.rb', line 40 def nginx_conf(file_path) @variables[:nginx_conf] = cert end |
.ssl_cert(cert_path) ⇒ Object
36 37 38 |
# File 'lib/xnlogic/server_profile.rb', line 36 def ssl_cert(cert_path) @variables[:ssl_cert] = cert end |
.user(u) ⇒ Object
32 33 34 |
# File 'lib/xnlogic/server_profile.rb', line 32 def user(u) @variables[:user] = u end |