Sha256: 3a2cdd5ea741f63d5934d0cec429370324d9bff99db0c73701df7576eb5d80e6

Contents?: true

Size: 705 Bytes

Versions: 31

Compression:

Stored size: 705 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]
        activerecord = tuple[:activerecord]
        db = tuple[:db]

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

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

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
schema_dev-4.0.0 lib/schema_dev/matrix_executor.rb
schema_dev-3.13.1 lib/schema_dev/matrix_executor.rb
schema_dev-3.13.0 lib/schema_dev/matrix_executor.rb
schema_dev-3.12.1 lib/schema_dev/matrix_executor.rb
schema_dev-3.12.0 lib/schema_dev/matrix_executor.rb
schema_dev-3.11.2 lib/schema_dev/matrix_executor.rb
schema_dev-3.11.1 lib/schema_dev/matrix_executor.rb
schema_dev-3.11.0 lib/schema_dev/matrix_executor.rb
schema_dev-3.10.1 lib/schema_dev/matrix_executor.rb
schema_dev-3.10.0 lib/schema_dev/matrix_executor.rb
schema_dev-3.9.0 lib/schema_dev/matrix_executor.rb
schema_dev-3.8.1 lib/schema_dev/matrix_executor.rb
schema_dev-3.8.0 lib/schema_dev/matrix_executor.rb
schema_dev-3.7.1 lib/schema_dev/matrix_executor.rb
schema_dev-3.7.0 lib/schema_dev/matrix_executor.rb
schema_dev-3.6.2 lib/schema_dev/matrix_executor.rb
schema_dev-3.6.1 lib/schema_dev/matrix_executor.rb
schema_dev-3.6.0 lib/schema_dev/matrix_executor.rb
schema_dev-3.5.1 lib/schema_dev/matrix_executor.rb
schema_dev-3.5.0 lib/schema_dev/matrix_executor.rb