Let App be aware of destination

This commit is contained in:
Tobias Bühlmann
2023-03-03 15:29:00 +01:00
parent cec3468f50
commit 170562c7e7
5 changed files with 43 additions and 21 deletions

View File

@@ -10,6 +10,7 @@ class Mrsk::Configuration
delegate :argumentize, :argumentize_env_with_secrets, to: Mrsk::Utils
attr_accessor :version
attr_accessor :destination
attr_accessor :raw_config
class << self
@@ -19,7 +20,7 @@ class Mrsk::Configuration
config.deep_merge! \
load_config_file destination_config_file(base_config_file, destination)
end
end, version: version)
end, destination: destination, version: version)
end
private
@@ -37,8 +38,9 @@ class Mrsk::Configuration
end
end
def initialize(raw_config, version: "missing", validate: true)
def initialize(raw_config, destination: nil, version: "missing", validate: true)
@raw_config = ActiveSupport::InheritableOptions.new(raw_config)
@destination = destination
@version = version
valid? if validate
end