Class: Wlog::TemplateUi
- Inherits:
-
Object
- Object
- Wlog::TemplateUi
- Includes:
- StaticConfigurations
- Defined in:
- lib/wlog/ui/template_ui.rb
Overview
Constant Summary
Constants included from StaticConfigurations
StaticConfigurations::AppDirectory, StaticConfigurations::AppName, StaticConfigurations::ConfigDirectory, StaticConfigurations::ConfigFile, StaticConfigurations::DataDirectory, StaticConfigurations::DefaultDb, StaticConfigurations::TaintFile, StaticConfigurations::TemplateDir, StaticConfigurations::TemplateOutputDir, StaticConfigurations::TemplateSampleFile
Instance Method Summary collapse
-
#initialize ⇒ TemplateUi
constructor
A new instance of TemplateUi.
- #run ⇒ Object
Constructor Details
#initialize ⇒ TemplateUi
Returns a new instance of TemplateUi.
13 14 15 16 17 |
# File 'lib/wlog/ui/template_ui.rb', line 13 def initialize @strmaker = SysConfig.string_decorator # Checks for templates dir each run BootstrapTemplates.new.execute end |
Instance Method Details
#run ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/wlog/ui/template_ui.rb', line 19 def run cmd = 'default' while cmd != 'end' cmd = Readline.readline("[#{@strmaker.green('templates')}] ").chomp case cmd when /^(ls|show)/ then ls when /^set/ then set(cmd.split.drop 1) when /^help/ then print_help when /^end/ then next end end end |