Class: Matrixeval::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/matrixeval/config.rb,
lib/matrixeval/config/yaml.rb

Defined Under Namespace

Classes: YAML

Class Method Summary collapse

Class Method Details

.all_mountsObject



83
84
85
# File 'lib/matrixeval/config.rb', line 83

def all_mounts
  mounts + all_variant_mounts
end

.commandsObject



64
65
66
67
# File 'lib/matrixeval/config.rb', line 64

def commands
  cmds = YAML["commands"] || []
  COMMANDS + target.support_commands + cmds
end

.docker_compose_extend_rawObject



69
70
71
72
73
# File 'lib/matrixeval/config.rb', line 69

def docker_compose_extend_raw
  DockerCompose::ExtendRaw.new(
    YAML["docker-compose-extend"] || {}
  )
end

.envObject



75
76
77
# File 'lib/matrixeval/config.rb', line 75

def env
  YAML["env"] || {}
end

.exclusionsObject



56
57
58
# File 'lib/matrixeval/config.rb', line 56

def exclusions
  YAML["exclude"] || []
end

.main_vectorObject



36
37
38
# File 'lib/matrixeval/config.rb', line 36

def main_vector
  vectors.find(&:main?)
end

.main_vector_variantsObject



48
49
50
# File 'lib/matrixeval/config.rb', line 48

def main_vector_variants
  main_vector.variants
end

.mountsObject



79
80
81
# File 'lib/matrixeval/config.rb', line 79

def mounts
  YAML["mounts"] || []
end

.parallel_workersObject



60
61
62
# File 'lib/matrixeval/config.rb', line 60

def parallel_workers
  YAML["parallel_workers"] || "number_of_processors"
end

.project_nameObject



20
21
22
23
24
25
26
27
28
# File 'lib/matrixeval/config.rb', line 20

def project_name
  name = YAML["project_name"]

  if name.nil? || name.strip.empty?
    raise Error.new('missing project_name')
  end

  name
end

.rest_vector_variants_matrixObject



52
53
54
# File 'lib/matrixeval/config.rb', line 52

def rest_vector_variants_matrix
  rest_vectors.map(&:variants)
end

.rest_vectorsObject



40
41
42
# File 'lib/matrixeval/config.rb', line 40

def rest_vectors
  vectors.reject(&:main?)
end

.targetObject



16
17
18
# File 'lib/matrixeval/config.rb', line 16

def target
  @target ||= target_klass.new
end

.target_nameObject



12
13
14
# File 'lib/matrixeval/config.rb', line 12

def target_name
  YAML["target"]
end

.variant_combinationsObject



44
45
46
# File 'lib/matrixeval/config.rb', line 44

def variant_combinations
  main_vector_variants.product(*rest_vector_variants_matrix)
end

.vectorsObject



30
31
32
33
34
# File 'lib/matrixeval/config.rb', line 30

def vectors
  @vectors = YAML["matrix"].map do |key, vector_config|
    Vector.new(key, vector_config)
  end
end

.versionObject



8
9
10
# File 'lib/matrixeval/config.rb', line 8

def version
  YAML["version"]
end