Class: Wlog::TemplateHelper

Inherits:
Object
  • Object
show all
Includes:
StaticConfigurations
Defined in:
lib/wlog/domain/template_helper.rb

Overview

Author:

  • Simon Symeonidis

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

Class Method Summary collapse

Class Method Details

.template_fileObject

Returns absolute path to the template the user has set.

Returns:

  • absolute path to the template the user has set



10
11
12
13
# File 'lib/wlog/domain/template_helper.rb', line 10

def self.template_file
  num = KeyValue.get('template') || 1
  Dir[TemplateDir + '*'][num.to_i - 1]
end

.template_sObject

Returns template contents of the current selected template.

Returns:

  • template contents of the current selected template



16
17
18
# File 'lib/wlog/domain/template_helper.rb', line 16

def self.template_s
  File.read(TemplateHelper.template_file)
end