مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2026-03-03 06:14:06 +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/fast_server.key
|
||||||
config/postal/**/*
|
config/postal/**/*
|
||||||
|
|
||||||
|
spec/config/postal.local.yml
|
||||||
|
|
||||||
public/assets
|
public/assets
|
||||||
vendor/bundle
|
vendor/bundle
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ module Postal
|
|||||||
@config ||= begin
|
@config ||= begin
|
||||||
require 'hashie/mash'
|
require 'hashie/mash'
|
||||||
config = Hashie::Mash.new(self.defaults)
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -64,6 +65,14 @@ module Postal
|
|||||||
@yaml_config ||= File.exist?(config_file_path) ? YAML.load_file(config_file_path) : {}
|
@yaml_config ||= File.exist?(config_file_path) ? YAML.load_file(config_file_path) : {}
|
||||||
end
|
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
|
def self.defaults_file_path
|
||||||
@defaults_file_path ||= app_root.join('config', 'postal.defaults.yml')
|
@defaults_file_path ||= app_root.join('config', 'postal.defaults.yml')
|
||||||
end
|
end
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم