Class: Wlog::ConfigurationUi

Inherits:
Object
  • Object
show all
Defined in:
lib/wlog/ui/configuration_ui.rb

Overview

Author:

  • Simon Symeonidis

Instance Method Summary collapse

Constructor Details

#initializeConfigurationUi

Default init



10
11
12
# File 'lib/wlog/ui/configuration_ui.rb', line 10

def initialize
  @strmaker = SysConfig.string_decorator
end

Instance Method Details

#runObject

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