Revision 1744c478
Added by Marc Dequènes over 15 years ago
- ID 1744c4788df2f00a4ae490d0cba9feaade7bc806
bin/shadowwalker | ||
---|---|---|
require 'yaml'
|
||
require 'cmdparse2'
|
||
|
||
config_str_prv = IO.read(File.join(LdapShadows::Config::CFG_DIR, "private.conf"))
|
||
config_str = IO.read(File.join(LdapShadows::Config::CFG_DIR, "test.conf"))
|
||
config = YAML.load(config_str_prv).merge(YAML.load(config_str)).recursive_symbolize_keys!
|
||
config = YAML.load(config_str)
|
||
config_str_prv_filelist = [
|
||
File.join(ENV['HOME'], ".shadowwalker"),
|
||
File.join(LdapShadows::Config::CFG_DIR, "private.conf")
|
||
]
|
||
config_str_prv_filelist.each do |file|
|
||
if File.exists?(file)
|
||
config_str_prv = IO.read(file)
|
||
config.merge!(YAML.load(config_str_prv))
|
||
break
|
||
end
|
||
end
|
||
config.recursive_symbolize_keys!
|
||
ActiveLdap::Base.setup_connection(config[:ldap])
|
||
|
||
cmdparser = CmdParse::CommandParser.new(true)
|
||
... | ... | |
I18n.default_locale = :en
|
||
|
||
ldapctl = LdapShadows::Controller.new
|
||
ldapctl.set_global_config(config[:presentation])
|
||
config[:aspects].each_pair do |aspect_name, aspect_data|
|
||
ldapctl.set_aspect(aspect_name, aspect_data)
|
||
end
|
Also available in: Unified diff
[evol] added private config load in home, and global hidden attributes (until something really proper is done for config)