Sha256: 7d3e80918ed036ba9d9988247f9c2a61fca6320bda8f1fdf337a35fe33908b44

Contents?: true

Size: 821 Bytes

Versions: 14

Compression:

Stored size: 821 Bytes

Contents

module Vx
  module Builder
    class BuildConfiguration
      class Env

        attr_reader :attributes

        def initialize(new_env)
          normalize_attributes(new_env)
        end

        def matrix
          @attributes["matrix"]
        end

        def global
          @attributes["global"]
        end

        private

          def normalize_attributes(new_env)

            @attributes =
              case new_env
              when Hash
                {
                  "matrix" => Array(new_env['matrix']),
                  "global" => Array(new_env['global'])
                }
              else
                {
                  "matrix" => Array(new_env).flatten.map(&:to_s),
                  "global" => []
                }
              end

          end

      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
vx-builder-0.2.2 lib/vx/builder/build_configuration/env.rb
vx-builder-0.2.1 lib/vx/builder/build_configuration/env.rb
vx-builder-0.2.0 lib/vx/builder/build_configuration/env.rb
vx-builder-0.1.8 lib/vx/builder/build_configuration/env.rb
vx-builder-0.1.7 lib/vx/builder/build_configuration/env.rb
vx-builder-0.1.6 lib/vx/builder/build_configuration/env.rb
vx-builder-0.1.5 lib/vx/builder/build_configuration/env.rb
vx-builder-0.1.4 lib/vx/builder/build_configuration/env.rb
vx-builder-0.1.3 lib/vx/builder/build_configuration/env.rb
vx-builder-0.1.2 lib/vx/builder/build_configuration/env.rb
vx-builder-0.1.1 lib/vx/builder/build_configuration/env.rb
vx-builder-0.1.0 lib/vx/builder/build_configuration/env.rb
vx-builder-0.0.29 lib/vx/builder/build_configuration/env.rb
vx-builder-0.0.28 lib/vx/builder/build_configuration/env.rb