Class: Ukiryu::CliCommands::ConfigCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Ukiryu::CliCommands::ConfigCommand
- Defined in:
- lib/ukiryu/cli_commands/config_command.rb
Overview
Configuration management command
Constant Summary collapse
- CONFIG_DIR =
File.('~/.ukiryu')
- CONFIG_FILE =
File.join(CONFIG_DIR, 'config.yml')
Instance Attribute Summary
Attributes inherited from BaseCommand
Instance Method Summary collapse
-
#run(action = 'list', key = nil, value = nil) ⇒ Object
Execute the config command.
Methods inherited from BaseCommand
#apply_cli_options_to_config, #default_register_path, #initialize, #setup_register, #stringify_keys
Constructor Details
This class inherits a constructor from Ukiryu::CliCommands::BaseCommand
Instance Method Details
#run(action = 'list', key = nil, value = nil) ⇒ Object
Execute the config command
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ukiryu/cli_commands/config_command.rb', line 18 def run(action = 'list', key = nil, value = nil) setup_register case action when 'list' action_list when 'get' action_get(key) when 'set' action_set(key, value) when 'unset' action_unset(key) else error! "Unknown action: #{action}\nValid actions: list, get, set, unset" end end |