From d22237d0ece0c8b978cc96ca93ec5fa47e5dde24 Mon Sep 17 00:00:00 2001 From: Adam Cooke Date: Mon, 14 Feb 2022 14:35:01 +0000 Subject: [PATCH] chore: support for different postal environments --- lib/postal/config.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/postal/config.rb b/lib/postal/config.rb index 7bff847..59d38bc 100644 --- a/lib/postal/config.rb +++ b/lib/postal/config.rb @@ -54,7 +54,17 @@ module Postal end 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 def self.yaml_config