Class: Kamal::Configuration::Env
- Inherits:
-
Object
- Object
- Kamal::Configuration::Env
- Includes:
- Validation
- Defined in:
- lib/kamal/configuration/env.rb
Defined Under Namespace
Classes: Tag
Instance Attribute Summary collapse
-
#clear ⇒ Object
readonly
Returns the value of attribute clear.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#secret_keys ⇒ Object
readonly
Returns the value of attribute secret_keys.
-
#secrets ⇒ Object
readonly
Returns the value of attribute secrets.
Instance Method Summary collapse
- #clear_args ⇒ Object
-
#initialize(config:, secrets:, context: "env") ⇒ Env
constructor
A new instance of Env.
- #merge(other) ⇒ Object
- #secrets_io ⇒ Object
Methods included from Validation
Constructor Details
#initialize(config:, secrets:, context: "env") ⇒ Env
Returns a new instance of Env.
8 9 10 11 12 13 14 |
# File 'lib/kamal/configuration/env.rb', line 8 def initialize(config:, secrets:, context: "env") @clear = config.fetch("clear", config.key?("secret") || config.key?("tags") ? {} : config) @secrets = secrets @secret_keys = config.fetch("secret", []) @context = context validate! config, context: context, with: Kamal::Configuration::Validator::Env end |
Instance Attribute Details
#clear ⇒ Object (readonly)
Returns the value of attribute clear.
5 6 7 |
# File 'lib/kamal/configuration/env.rb', line 5 def clear @clear end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
4 5 6 |
# File 'lib/kamal/configuration/env.rb', line 4 def context @context end |
#secret_keys ⇒ Object (readonly)
Returns the value of attribute secret_keys.
5 6 7 |
# File 'lib/kamal/configuration/env.rb', line 5 def secret_keys @secret_keys end |
#secrets ⇒ Object (readonly)
Returns the value of attribute secrets.
4 5 6 |
# File 'lib/kamal/configuration/env.rb', line 4 def secrets @secrets end |
Instance Method Details
#clear_args ⇒ Object
16 17 18 |
# File 'lib/kamal/configuration/env.rb', line 16 def clear_args argumentize("--env", clear) end |
#merge(other) ⇒ Object
24 25 26 27 28 |
# File 'lib/kamal/configuration/env.rb', line 24 def merge(other) self.class.new \ config: { "clear" => clear.merge(other.clear), "secret" => secret_keys | other.secret_keys }, secrets: secrets end |