Sha256: 715a0a58ecbc92266412ecffd2faf722ffc7c6c4e6e27df404e4c3441be2dda9

Contents?: true

Size: 1.21 KB

Versions: 73

Compression:

Stored size: 1.21 KB

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

module GoodData
  module LCM2
    class Helpers
      class << self
        # @param Array of segments as in release brick parameters
        # @return Hash of segments and production tags
        # @example { { segment: 'tag1, tag1' } }
        def segment_production_tags(segments)
          return {} unless segments
          segments
            .reject { |s| s.production_tags.nil? }
            .map { |s| [s.segment_id, s.production_tags] }
            .to_h
        end

        # @param production_tags Global production tags
        # @param segment_production_tags Segment-specific production tags
        # @return Array of production tags
        # @example ['tag1', 'tag2']
        def parse_production_tags(production_tags, segment_production_tags)
          separator = ','
          tags = segment_production_tags || production_tags
          return [] unless tags
          tags = tags.split(separator).map(&:strip) unless tags.is_a?(Array)
          tags
        end
      end
    end
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
gooddata-2.3.1-java lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.3.1 lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.3.0-java lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.3.0 lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.2.0-java lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.2.0 lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.1.19-java lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.1.19 lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.1.17-java lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.1.17 lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.1.15-java lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.1.15 lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.1.14-java lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.1.14 lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.1.13-java lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.1.13 lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.1.12-java lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.1.12 lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.1.11-java lib/gooddata/lcm/helpers/tags_helper.rb
gooddata-2.1.11 lib/gooddata/lcm/helpers/tags_helper.rb