CONTRIBUTORS = YAML.load_file('CONTRIBUTORS.yaml')
ORGANISATIONS = YAML.load_file('ORGANISATIONS.yaml')
GRANTS = YAML.load_file('GRANTS.yaml')
def automagic_loading(f)
f.reject! { |k, v| k == 'description' and v.is_a?(String) }
f.reject! { |k| k == '_examples' }
f.each do |k, v|
if v.is_a?(Hash)
automagic_loading(v)
elsif v.is_a?(Array)
if k == 'enum'
repl = []
repl << CONTRIBUTORS.keys if v.find { |x| x == 'CONTRIBUTORS' }
repl << GRANTS.keys if v.find { |x| x == 'GRANTS' }
repl << ORGANISATIONS.keys if v.find { |x| x == 'ORGANISATIONS' }
v.replace repl.flatten if repl.length.positive?
end
v.flatten.each { |x| automagic_loading(x) if x.is_a?(Hash) }
end
end
f
end