مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-11-30 21:32:30 +00:00
feat(config): support for loading a postal.local.yml config file from the config root if it exists
هذا الالتزام موجود في:
1
.gitignore
مباع
1
.gitignore
مباع
@@ -25,6 +25,7 @@ config/fast_server.cert
|
||||
config/fast_server.key
|
||||
config/postal/**/*
|
||||
|
||||
spec/config/postal.local.yml
|
||||
|
||||
public/assets
|
||||
vendor/bundle
|
||||
|
||||
@@ -28,7 +28,8 @@ module Postal
|
||||
@config ||= begin
|
||||
require 'hashie/mash'
|
||||
config = Hashie::Mash.new(self.defaults)
|
||||
config.deep_merge(self.yaml_config)
|
||||
config = config.deep_merge(self.yaml_config)
|
||||
config.deep_merge(self.local_yaml_config)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -64,6 +65,14 @@ module Postal
|
||||
@yaml_config ||= File.exist?(config_file_path) ? YAML.load_file(config_file_path) : {}
|
||||
end
|
||||
|
||||
def self.local_config_file_path
|
||||
@local_config_file_path ||= File.join(config_root, 'postal.local.yml')
|
||||
end
|
||||
|
||||
def self.local_yaml_config
|
||||
@local_yaml_config ||= File.exist?(local_config_file_path) ? YAML.load_file(local_config_file_path) : {}
|
||||
end
|
||||
|
||||
def self.defaults_file_path
|
||||
@defaults_file_path ||= app_root.join('config', 'postal.defaults.yml')
|
||||
end
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم