Sha256: f8196b3f84ce8ecb88b322de0232f7722fb32e3810794be99088e9538cadd769

Contents?: true

Size: 781 Bytes

Versions: 14

Compression:

Stored size: 781 Bytes

Contents

module Climatic
  module ConfigLayers

    class SystemLayer < Climatic::ConfigLayers::GenericLayer

      SYSTEM_CONFIG_ROOT = {
          windows: [File.join(ENV['systemRoot'] || '', 'Config')],
          unix: '/etc'
      }

      def self.system_config_root
        SYSTEM_CONFIG_ROOT[os_flavour]
      end

      def system_config_root
        self.class.system_config_root
      end


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

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


    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
climatic-0.2.40 lib/climatic/config_layers/system_layer.rb
climatic-0.2.39 lib/climatic/config_layers/system_layer.rb
climatic-0.2.38 lib/climatic/config_layers/system_layer.rb
climatic-0.2.37 lib/climatic/config_layers/system_layer.rb
climatic-0.2.36 lib/climatic/config_layers/system_layer.rb
climatic-0.2.35 lib/climatic/config_layers/system_layer.rb
climatic-0.2.34 lib/climatic/config_layers/system_layer.rb
climatic-0.2.32 lib/climatic/config_layers/system_layer.rb
climatic-0.2.31 lib/climatic/config_layers/system_layer.rb
climatic-0.2.30 lib/climatic/config_layers/system_layer.rb
climatic-0.2.29 lib/climatic/config_layers/system_layer.rb
climatic-0.2.28 lib/climatic/config_layers/system_layer.rb
climatic-0.2.27 lib/climatic/config_layers/system_layer.rb
climatic-0.2.26 lib/climatic/config_layers/system_layer.rb