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
|
# File 'lib/madness/commands/config.rb', line 20
def show_command
errors_found = false
config.data.each do |key, value|
value_color = config.defaults[key] == value ? 'n' : 'bb'
if config.defaults.has_key?(key)
key_color = 'g'
else
key_color = 'r'
value_color = 'r'
errors_found = true
end
say "#{key_color}`#{key.to_s.rjust 20}`: #{value_color}`#{value || '~'}`"
end
say ''
if config.file_exist?
say "Values in bb`blue` loaded from g`#{config.filename}`"
end
return unless errors_found
say 'Keys in r`red` are not recognized'
end
|