Sha256: 855a3ae97767e0e6338fb84ae447aa12d360863b6ead6cfbfcff44dada5e0a25

Contents?: true

Size: 796 Bytes

Versions: 99

Compression:

Stored size: 796 Bytes

Contents

module PactBroker
  module Api
    module Renderers
      class IntegrationsDotRenderer
        def initialize(integrations)
          @integrations = integrations
        end

        def self.call(integrations)
          new(integrations).call
        end

        def call
          "digraph { ranksep=3; ratio=auto; overlap=false; node [  shape = plaintext, fontname = Helvetica ];
#{integrations_graph}
}
"
        end

        private

        attr_reader :integrations

        def integrations_graph
          integrations
            .collect{ | integration| "  #{escape_name(integration.consumer_name)} -> #{escape_name(integration.provider_name)}" }
            .join("\n")
        end

        def escape_name(name)
          name.tr(" ", "_")
        end
      end
    end
  end
end

Version data entries

99 entries across 99 versions & 1 rubygems

Version Path
pact_broker-2.112.0 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.111.0 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.109.1 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.109.0 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.108.0 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.107.1 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.107.0 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.107.0.beta.1 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.106.0 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.105.0 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.104.0 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.103.0 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.102.2 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.102.1 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.102.0 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.101.0 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.100.0 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.99.0 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.98.0 lib/pact_broker/api/renderers/integrations_dot_renderer.rb
pact_broker-2.97.0 lib/pact_broker/api/renderers/integrations_dot_renderer.rb