Class: Kamal::Configuration::Boot
- Inherits:
-
Object
- Object
- Kamal::Configuration::Boot
- Includes:
- Validation
- Defined in:
- lib/kamal/configuration/boot.rb
Instance Attribute Summary collapse
-
#boot_config ⇒ Object
readonly
Returns the value of attribute boot_config.
-
#host_count ⇒ Object
readonly
Returns the value of attribute host_count.
Instance Method Summary collapse
-
#initialize(config:) ⇒ Boot
constructor
A new instance of Boot.
- #limit ⇒ Object
- #wait ⇒ Object
Methods included from Validation
Constructor Details
#initialize(config:) ⇒ Boot
Returns a new instance of Boot.
6 7 8 9 10 |
# File 'lib/kamal/configuration/boot.rb', line 6 def initialize(config:) @boot_config = config.raw_config.boot || {} @host_count = config.all_hosts.count validate! boot_config end |
Instance Attribute Details
#boot_config ⇒ Object (readonly)
Returns the value of attribute boot_config.
4 5 6 |
# File 'lib/kamal/configuration/boot.rb', line 4 def boot_config @boot_config end |
#host_count ⇒ Object (readonly)
Returns the value of attribute host_count.
4 5 6 |
# File 'lib/kamal/configuration/boot.rb', line 4 def host_count @host_count end |
Instance Method Details
#limit ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/kamal/configuration/boot.rb', line 12 def limit limit = boot_config["limit"] if limit.to_s.end_with?("%") [ host_count * limit.to_i / 100, 1 ].max else limit end end |
#wait ⇒ Object
22 23 24 |
# File 'lib/kamal/configuration/boot.rb', line 22 def wait boot_config["wait"] end |