Sha256: 66c2c2fcfc145d3483bc0c37fd0566f096cf6e06d35be4d83c2882f7334973c4

Contents?: true

Size: 909 Bytes

Versions: 14

Compression:

Stored size: 909 Bytes

Contents

module Climatic
  module ConfigLayers

    module SourceHelper

      OS_FLAVOURS = {
          mingw32: :windows,
          linux: :unix
      }
      DEFAULT_OS_FLAVOUR = :unix


      EXTENSIONS = %w(conf CONF cfg CFG yml YML yaml YAML)

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

      module ClassMethods
        def os_flavour
          Climatic::ConfigLayers::SourceHelper.os_flavour
        end

        def supported_oses
          Climatic::ConfigLayers::SourceHelper.supported_oses
        end
      end

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

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

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

      def supported_oses
        self.class.supported_oses
      end

    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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