lib/evrone/ci/router/build_matrix.rb in evrone-ci-router-0.2.0.pre0 vs lib/evrone/ci/router/build_matrix.rb in evrone-ci-router-0.2.0.pre1
- old
+ new
@@ -2,10 +2,11 @@
module CI
class Router
class BuildMatrix
KEYS = (Travis::LANGS + %w{ env }).freeze
+ NOT_MATRIX_KEYS = %w{ script before_script }
attr_reader :travis
def initialize(travis)
@travis = travis
@@ -15,10 +16,15 @@
extract_pair_of_key_and_values.map(&:first).sort
end
def travises
attributes_for_new_travises.map do |attrs|
- Travis.new attrs
+ Travis.new attrs.merge(
+ NOT_MATRIX_KEYS.inject({}) do |a,v|
+ a[v] = travis.public_send(v)
+ a
+ end
+ )
end
end
def attributes_for_new_travises
permutate_and_build_values.inject([]) do |ac, values|