chore: support for different postal environments

This commit is contained in:
Adam Cooke
2022-02-14 14:35:01 +00:00
parent 51e3a1fb5e
commit d22237d0ec
+11 -1
View File
@@ -54,7 +54,17 @@ module Postal
end end
def self.config_file_path def self.config_file_path
@config_file_path ||= File.join(config_root, 'postal.yml') @config_file_path ||= begin
if env == 'default'
File.join(config_root, 'postal.yml')
else
File.join(config_root, "postal.#{env}.yml")
end
end
end
def self.env
@env ||= ENV.fetch('POSTAL_ENV', 'default')
end end
def self.yaml_config def self.yaml_config