Revision a65fd5e8
Added by Marc Dequènes over 14 years ago
- ID a65fd5e8dada1d5a31bfb01101bcd9888bbcb9fb
lib/ldap_shadows/config.rb | ||
---|---|---|
config = File.read(config_file)
|
||
|
||
shadow = Shadow.new(shadow_name)
|
||
# register early (needed to load hooks)
|
||
@shadows[shadow_name] = {
|
||
:config_path => shadow_config_path,
|
||
:shadow => shadow
|
||
}
|
||
shadow.set_shadow_config(config)
|
||
|
||
load_config_components(shadow_config_path, 'aspects') do |c_name, c_config|
|
||
... | ... | |
I18n.load_path += Dir[File.join(translation_path, "**", "*.yml")]
|
||
end
|
||
|
||
@shadows[shadow_name] = {
|
||
:config_path => shadow_config_path,
|
||
:shadow => shadow
|
||
}
|
||
|
||
shadow
|
||
rescue
|
||
raise PreProcessingError, _("Could not load shadow configuration: %s") % $!
|
||
... | ... | |
def_data.recursive_symbolize_keys!
|
||
end
|
||
|
||
def load_hook_content(shadow_name, type, hook_name)
|
||
s_info = get_shadow_info(shadow_name)
|
||
return nil if s_info.nil?
|
||
|
||
filename = File.join(s_info[:config_path], "hooks", type.pluralize, hook_name.to_s.downcase + ".rb")
|
||
return nil unless File.exists?(filename)
|
||
|
||
File.read(filename)
|
||
end
|
||
|
||
protected
|
||
|
||
def load_config_components(shadow_config_path, type)
|
Also available in: Unified diff
[fix] aspect hooks loading was broken, and moved file loading into the Config class