Class: Wlog::ConfigurationUi
- Inherits:
-
Object
- Object
- Wlog::ConfigurationUi
- Defined in:
- lib/wlog/ui/configuration_ui.rb
Overview
Instance Method Summary collapse
-
#initialize ⇒ ConfigurationUi
constructor
Default init.
-
#run ⇒ Object
launch the ui.
Constructor Details
#initialize ⇒ ConfigurationUi
Default init
10 11 12 |
# File 'lib/wlog/ui/configuration_ui.rb', line 10 def initialize @strmaker = SysConfig.string_decorator end |
Instance Method Details
#run ⇒ Object
launch the ui
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/wlog/ui/configuration_ui.rb', line 15 def run cmd = "default" label = @strmaker.yellow('config') until cmd == "end" do cmd = Readline.readline("[#{label}] ") || "end" cmd.chomp! case cmd when /^show/ then show_configurations when /^set/ then set(cmd) when /^help/ then help end end end |