Sha256: 2a41ca794d13866974f5af417c7016dfea2e34b22b9b8ec481abe9c2d7dfe9d3

Contents?: true

Size: 663 Bytes

Versions: 17

Compression:

Stored size: 663 Bytes

Contents

require_relative 'executor'

module SchemaDev
  class MatrixExecutor
    attr_reader :errors

    def initialize(matrix)
      @matrix = matrix
    end

    def run(cmd, dry_run: false)
      @errors = []
      @matrix.each_with_index do |tuple, i|
        ruby = tuple[:ruby]
        rails = tuple[:rails]
        db = tuple[:db]

        label = "ruby #{ruby} - rails #{rails} - db #{db}"
        msg = "#{label} [#{i+1} of #{@matrix.size}]"
        puts "\n\n*** #{msg}\n\n"

        if not Executor.new(ruby: ruby, rails: rails, db: db).run(cmd, dry_run: dry_run)
          @errors << label
        end
      end
      return @errors.empty?
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
schema_dev-2.0.4 lib/schema_dev/matrix_executor.rb
schema_dev-2.0.3 lib/schema_dev/matrix_executor.rb
schema_dev-2.0.2 lib/schema_dev/matrix_executor.rb
schema_dev-2.0.1 lib/schema_dev/matrix_executor.rb
schema_dev-2.0.0 lib/schema_dev/matrix_executor.rb
schema_dev-1.4.0 lib/schema_dev/matrix_executor.rb
schema_dev-1.3.0 lib/schema_dev/matrix_executor.rb
schema_dev-1.2.5 lib/schema_dev/matrix_executor.rb
schema_dev-1.2.4 lib/schema_dev/matrix_executor.rb
schema_dev-1.2.3 lib/schema_dev/matrix_executor.rb
schema_dev-1.2.2 lib/schema_dev/matrix_executor.rb
schema_dev-1.2.1 lib/schema_dev/matrix_executor.rb
schema_dev-1.2.0 lib/schema_dev/matrix_executor.rb
schema_dev-1.1.0 lib/schema_dev/matrix_executor.rb
schema_dev-1.0.3 lib/schema_dev/matrix_executor.rb
schema_dev-1.0.2 lib/schema_dev/matrix_executor.rb
schema_dev-1.0.1 lib/schema_dev/matrix_executor.rb