Project

General

Profile

« Previous | Next » 

Revision 9a7f1b63

Added by Marc Dequènes over 14 years ago

  • ID 9a7f1b6328d8f9529a200b342bac8d6296eb643e

[evol] added default config and simplified MilkyPond shadow config (and minor other changes)

View differences:

lib/ldap_shadows/shadow.rb
end
def set_config(shadow_def_raw)
@shadow_config = @config.parse_and_validate(@name, 'shadow', shadow_def_raw)
shadow_default_config = @config.load_default_config('shadow')
shadow_def = @config.parse(@name, 'shadow', shadow_def_raw)
@shadow_config = shadow_default_config.recursive_merge(shadow_def)
end
def get_config
......
raise PreProcessingError, _("Element '%s' for model '%s' as already been defined") % [e_name, e_type]
end
e_def = @config.parse_and_validate(e_name, e_type, e_def_raw)
e_def = @config.parse(e_name, e_type, e_def_raw)
e_default_parameters = @config.load_default_config(e_type)
e_config = e_default_parameters.recursive_merge(e_def)
klass = @container.module_eval(<<-EOS)
class #{klass_name} < #{superklass_location}::#{superklass_name}; self; end
......
klass.instance_variable_set(:@handle, e_name)
klass.instance_variable_set(:@shadow, self)
klass.instance_variable_set(:@config, @config)
klass.instance_variable_set(:@parameters, e_def)
klass.instance_variable_set(:@parameters, e_config)
klass.meta_eval do
attr_reader :handle, :shadow, :config, :parameters
end

Also available in: Unified diff