Sha256: 31a93608e5b8e10dd4b2b31a270e4e2d2037ba99a8a4c534bf54d1e04ac2ddf0

Contents?: true

Size: 827 Bytes

Versions: 26

Compression:

Stored size: 827 Bytes

Contents

module TreasureData
  class ConnectorConfigNormalizer
    def initialize(config)
      @config = config
    end

    def normalized_config
      case
      when @config['in']
        {
          'in'      => @config['in'],
          'out'     => @config['out']  || {},
          'exec'    => @config['exec'] || {},
          'filters' => @config['filters'] || []
        }
      when @config['config']
        if @config.size != 1
          raise "Setting #{(@config.keys - ['config']).inspect} keys in a configuration file is not supported. Please set options to the command line argument."
        end

        self.class.new(@config['config']).normalized_config
      else
        {
          'in'   => @config,
          'out'  => {},
          'exec' => {},
          'filters' => []
        }
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
td-0.17.1 lib/td/connector_config_normalizer.rb
td-0.17.0 lib/td/connector_config_normalizer.rb
td-0.16.10 lib/td/connector_config_normalizer.rb
td-0.16.9 lib/td/connector_config_normalizer.rb
td-0.16.8 lib/td/connector_config_normalizer.rb
td-0.16.7 lib/td/connector_config_normalizer.rb
td-0.16.6 lib/td/connector_config_normalizer.rb
td-0.16.5 lib/td/connector_config_normalizer.rb
td-0.16.4 lib/td/connector_config_normalizer.rb
td-0.16.3 lib/td/connector_config_normalizer.rb
td-0.16.1 lib/td/connector_config_normalizer.rb
td-0.16.0 lib/td/connector_config_normalizer.rb
td-0.15.9 lib/td/connector_config_normalizer.rb
td-0.15.8 lib/td/connector_config_normalizer.rb
td-0.15.7 lib/td/connector_config_normalizer.rb
td-0.15.6 lib/td/connector_config_normalizer.rb
td-0.15.5 lib/td/connector_config_normalizer.rb
td-0.15.4 lib/td/connector_config_normalizer.rb
td-0.15.3 lib/td/connector_config_normalizer.rb
td-0.15.2 lib/td/connector_config_normalizer.rb