Sha256: b0354d56a2809143b21c039aba1fa494168291981c2a3beca84bfc0a2bff62bc

Contents?: true

Size: 1010 Bytes

Versions: 42

Compression:

Stored size: 1010 Bytes

Contents

require 'ostruct'
require 'pact_broker/api/pact_broker_urls'
require 'pact_broker/api/decorators/matrix_decorator'

require 'table_print'

module PactBroker
  module Api
    module Decorators
      class MatrixTextDecorator
        Line = Struct.new(:consumer, :c_version, :revision, :provider, :p_version, :number, :success)

        def initialize(lines)
          @lines = lines
        end

        def to_text(options)
          json_decorator = PactBroker::Api::Decorators::MatrixDecorator.new(lines)
          data = lines.collect do | line |
            Line.new(line.consumer_name, line.consumer_version_number, line.pact_revision_number, line.provider_name, line.provider_version_number, line.verification_number, line.success)
          end
          printer = TablePrint::Printer.new(data)
          printer.table_print + "\n\nDeployable: #{json_decorator.deployable.inspect}\nReason: #{json_decorator.reason}\n"
        end

        private

        attr_reader :lines
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
pact_broker-2.79.1 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.79.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.78.1 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.78.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.77.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.76.2 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.76.1 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.76.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.75.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.74.1 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.74.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.73.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.72.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.71.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.70.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.69.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.68.1 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.68.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.67.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.66.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb