Class: Matrixeval::Config
- Inherits:
-
Object
- Object
- Matrixeval::Config
- Defined in:
- lib/matrixeval/config.rb,
lib/matrixeval/config/yaml.rb
Defined Under Namespace
Classes: YAML
Class Method Summary collapse
- .all_mounts ⇒ Object
- .commands ⇒ Object
- .docker_compose_extend_raw ⇒ Object
- .env ⇒ Object
- .exclusions ⇒ Object
- .main_vector ⇒ Object
- .main_vector_variants ⇒ Object
- .mounts ⇒ Object
- .parallel_workers ⇒ Object
- .project_name ⇒ Object
- .rest_vector_variants_matrix ⇒ Object
- .rest_vectors ⇒ Object
- .target ⇒ Object
- .target_name ⇒ Object
- .variant_combinations ⇒ Object
- .vectors ⇒ Object
- .version ⇒ Object
Class Method Details
.all_mounts ⇒ Object
83 84 85 |
# File 'lib/matrixeval/config.rb', line 83 def all_mounts mounts + all_variant_mounts end |
.commands ⇒ Object
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_raw ⇒ Object
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 |
.env ⇒ Object
75 76 77 |
# File 'lib/matrixeval/config.rb', line 75 def env YAML["env"] || {} end |
.exclusions ⇒ Object
56 57 58 |
# File 'lib/matrixeval/config.rb', line 56 def exclusions YAML["exclude"] || [] end |
.main_vector ⇒ Object
36 37 38 |
# File 'lib/matrixeval/config.rb', line 36 def main_vector vectors.find(&:main?) end |
.main_vector_variants ⇒ Object
48 49 50 |
# File 'lib/matrixeval/config.rb', line 48 def main_vector_variants main_vector.variants end |
.mounts ⇒ Object
79 80 81 |
# File 'lib/matrixeval/config.rb', line 79 def mounts YAML["mounts"] || [] end |
.parallel_workers ⇒ Object
60 61 62 |
# File 'lib/matrixeval/config.rb', line 60 def parallel_workers YAML["parallel_workers"] || "number_of_processors" end |
.project_name ⇒ Object
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_matrix ⇒ Object
52 53 54 |
# File 'lib/matrixeval/config.rb', line 52 def rest_vector_variants_matrix rest_vectors.map(&:variants) end |
.rest_vectors ⇒ Object
40 41 42 |
# File 'lib/matrixeval/config.rb', line 40 def rest_vectors vectors.reject(&:main?) end |
.target ⇒ Object
16 17 18 |
# File 'lib/matrixeval/config.rb', line 16 def target @target ||= target_klass.new end |
.target_name ⇒ Object
12 13 14 |
# File 'lib/matrixeval/config.rb', line 12 def target_name YAML["target"] end |
.variant_combinations ⇒ Object
44 45 46 |
# File 'lib/matrixeval/config.rb', line 44 def variant_combinations main_vector_variants.product(*rest_vector_variants_matrix) end |
.vectors ⇒ Object
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 |
.version ⇒ Object
8 9 10 |
# File 'lib/matrixeval/config.rb', line 8 def version YAML["version"] end |