Class: Climatic::ConfigLayers::UserLayer
- Inherits:
-
GenericLayer
- Object
- SuperStack::Layer
- GenericLayer
- Climatic::ConfigLayers::UserLayer
- Defined in:
- lib/climatic/config_layers/user_layer.rb
Constant Summary
Constants included from SourceHelper
SourceHelper::DEFAULT_OS_FLAVOUR, SourceHelper::EXTENSIONS, SourceHelper::OS_FLAVOURS
Class Method Summary collapse
Instance Method Summary collapse
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 Climatic::ConfigLayers::GenericLayer
Class Method Details
.user_config_root ⇒ Object
7 8 9 |
# File 'lib/climatic/config_layers/user_layer.rb', line 7 def self.user_config_root Dir.home end |
Instance Method Details
#perform_substitutions(path_part) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/climatic/config_layers/user_layer.rb', line 27 def perform_substitutions path_part res = path_part.dup res.gsub! '##USER_CONFIG_ROOT##', user_config_root exec_name = manager.nil? ? Climatic::LayersManager.default_config_file_base_name : manager.config_file_base_name res.gsub! '##PROGRAM_NAME##', exec_name res end |
#possible_sources ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/climatic/config_layers/user_layer.rb', line 16 def possible_sources [ ['##USER_CONFIG_ROOT##', '.##PROGRAM_NAME##.##EXTENSION##' ], ['##USER_CONFIG_ROOT##', '.config', '##PROGRAM_NAME##.##EXTENSION##' ], ['##USER_CONFIG_ROOT##', '.config', '##PROGRAM_NAME##', 'config.##EXTENSION##' ], ['##USER_CONFIG_ROOT##', '.config', '##PROGRAM_NAME##', '##PROGRAM_NAME##.##EXTENSION##' ], ['##USER_CONFIG_ROOT##', '.##PROGRAM_NAME##', 'config.##EXTENSION##' ], ['##USER_CONFIG_ROOT##', '.##PROGRAM_NAME##', '##PROGRAM_NAME##.##EXTENSION##' ] ] end |
#user_config_root ⇒ Object
11 12 13 |
# File 'lib/climatic/config_layers/user_layer.rb', line 11 def user_config_root self.class.user_config_root end |