7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/pokotarou/registration_config_maker/preset_option_setter.rb', line 7
def set all_content
new_preset_config = {}
preset_path = []
all_content[:"preset_path'"].each do |path|
YAML.load_file(path).deep_symbolize_keys!.each do |preset|
if :"preset_path'" == preset.first
preset_path.concat(preset.second)
else
new_preset_config[preset.first] = preset.second
end
end
end
all_content.delete(:"preset_path'")
if preset_path.size != 0
preset_path.uniq!
all_content[:"preset_path'"] = preset_path
end
copy_config = {}
all_content.each do |config|
key = config.first
value = config.second
copy_config[key] = value
all_content.delete(key)
end
merge(all_content, new_preset_config)
merge(all_content, copy_config)
if all_content.has_key?(:"preset_path'")
set(all_content)
end
all_content
end
|