Sha256: 6b06a0bcf4764df38204ad2c7362d4a8196eea4fdeb5b9b9c2cea8ef211b8a05
Contents?: true
Size: 1.04 KB
Versions: 31
Compression:
Stored size: 1.04 KB
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 String { "matrix" => [], "global" => Array(new_env) } when Hash { "matrix" => Array(new_env['matrix']), "global" => Array(new_env['global']) } else env = Array(new_env).flatten.map(&:to_s) if env.size == 1 { "matrix" => [], "global" => env } else { "matrix" => env, "global" => [] } end end end end end end end
Version data entries
31 entries across 31 versions & 1 rubygems