Sha256: 3e27b8808356ed5c1c1ba04f190d7d0a411cf3970bd3bef0e89162f9bb3583d6

Contents?: true

Size: 1 KB

Versions: 63

Compression:

Stored size: 1 KB

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

63 entries across 63 versions & 1 rubygems

Version Path
pact_broker-2.51.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.50.1 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.50.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.49.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.48.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.47.1 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.47.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.46.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.45.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.44.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.43.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.42.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.41.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.40.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.39.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.38.1 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.38.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.37.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.36.1 lib/pact_broker/api/decorators/matrix_text_decorator.rb
pact_broker-2.36.0 lib/pact_broker/api/decorators/matrix_text_decorator.rb