Module: StackedConfig::SourceHelper

Included in:
Layers::GenericLayer
Defined in:
lib/stacked_config/source_helper.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

OS_FLAVOURS =
{
    mingw32: :windows,
    linux: :unix
}
DEFAULT_OS_FLAVOUR =
:unix
EXTENSIONS =
%w(conf CONF cfg CFG yml YML yaml YAML)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object


13
14
15
# File 'lib/stacked_config/source_helper.rb', line 13

def self.included(base)
  base.extend ClassMethods
end

.os_flavourObject


27
28
29
# File 'lib/stacked_config/source_helper.rb', line 27

def self.os_flavour
  OS_FLAVOURS[RbConfig::CONFIG['target_os'].to_sym] || DEFAULT_OS_FLAVOUR
end

.supported_osesObject


31
32
33
# File 'lib/stacked_config/source_helper.rb', line 31

def self.supported_oses
  OS_FLAVOURS.values.sort.uniq
end

Instance Method Details

#os_flavourObject


35
36
37
# File 'lib/stacked_config/source_helper.rb', line 35

def os_flavour
  @os_flavour ||= self.class.os_flavour
end

#supported_osesObject


39
40
41
# File 'lib/stacked_config/source_helper.rb', line 39

def supported_oses
  self.class.supported_oses
end