Class: Fontist::ConfigCLI
Instance Method Summary
collapse
#handle_class_options, included, #log_level
Instance Method Details
#delete(key) ⇒ Object
32
33
34
35
36
37
38
39
|
# File 'lib/fontist/config_cli.rb', line 32
def delete(key)
handle_class_options(options)
Config.instance.delete(key)
Fontist.ui.success(
"'#{key}' reset to default ('#{Config.instance.default_value(key)}').",
)
CLI::STATUS_SUCCESS
end
|
#keys ⇒ Object
42
43
44
45
46
47
48
49
|
# File 'lib/fontist/config_cli.rb', line 42
def keys
handle_class_options(options)
Fontist.ui.say("Available keys:")
Config.instance.default_values.each do |key, value|
Fontist.ui.say("#{key} (default: #{value})")
end
CLI::STATUS_SUCCESS
end
|
#set(key, value) ⇒ Object
#show ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/fontist/config_cli.rb', line 6
def show
handle_class_options(options)
values = Config.instance.custom_values
if values.empty?
Fontist.ui.success("Config is empty.")
else
Fontist.ui.success("Current config:")
Fontist.ui.success(format_hash(values))
end
CLI::STATUS_SUCCESS
end
|