Class: StackedConfig::Layers::GlobalLayer

Inherits:
SystemLayer show all
Defined in:
lib/stacked_config/layers/global_layer.rb

Constant Summary

Constants inherited from SystemLayer

SystemLayer::SYSTEM_CONFIG_ROOT

Constants included from SourceHelper

SourceHelper::DEFAULT_OS_FLAVOUR, SourceHelper::EXTENSIONS, SourceHelper::OS_FLAVOURS

Instance Method Summary collapse

Methods inherited from SystemLayer

system_config_root, #system_config_root

Methods inherited from GenericLayer

#initialize, #possible_config_files, #rescan

Methods included from SourceHelper

included, os_flavour, #os_flavour, supported_oses, #supported_oses

Constructor Details

This class inherits a constructor from StackedConfig::Layers::GenericLayer

Instance Method Details

#perform_substitutions(path_part) ⇒ Object


13
14
15
16
17
18
19
20
21
# File 'lib/stacked_config/layers/global_layer.rb', line 13

def perform_substitutions(path_part)
  res = path_part.dup
  res.gsub! '##SYSTEM_CONFIG_ROOT##', system_config_root

  exec_name = manager.nil? ? StackedConfig::Orchestrator.default_config_file_base_name : manager.config_file_base_name
  res.gsub! '##PROGRAM_NAME##', exec_name

  res
end

#possible_sourcesObject


5
6
7
8
9
10
11
# File 'lib/stacked_config/layers/global_layer.rb', line 5

def possible_sources
  [
      ['##SYSTEM_CONFIG_ROOT##', '##PROGRAM_NAME##.##EXTENSION##' ],
      ['##SYSTEM_CONFIG_ROOT##', '##PROGRAM_NAME##', 'config.##EXTENSION##' ],
      ['##SYSTEM_CONFIG_ROOT##', '##PROGRAM_NAME##', '##PROGRAM_NAME##.##EXTENSION##' ]
  ]
end