Sha256: 7a5279068a107d843be1f4a39fac2e00830cc1577efec6c0d7278f5d7242d0e9

Contents?: true

Size: 1.02 KB

Versions: 8

Compression:

Stored size: 1.02 KB

Contents

module Pact
  module PactBroker
    module PactSelectionDescription
      def pact_selection_description(provider, consumer_version_selectors, options, broker_base_url)
        latest = consumer_version_selectors.any? ? "" : "latest "
        message = "Fetching pacts for #{provider} from #{broker_base_url} with the selection criteria: "
        if consumer_version_selectors.any?
          desc = consumer_version_selectors.collect do |selector|
            all_or_latest = !selector[:latest] ? "all for tag" : "latest for tag"
            # TODO support fallback
            fallback = selector[:fallback] || selector[:fallbackTag]
            name = fallback ? "#{selector[:tag]} (or #{fallback} if not found)" : selector[:tag]
            "#{all_or_latest} #{name}"
          end.join(", ")
          if options[:include_wip_pacts_since]
            desc = "#{desc}, work in progress pacts created after #{options[:include_wip_pacts_since]}"
          end
          message << "#{desc}"
        end
        message
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pact-1.54.0 lib/pact/pact_broker/pact_selection_description.rb
pact-1.53.0 lib/pact/pact_broker/pact_selection_description.rb
pact-1.52.0 lib/pact/pact_broker/pact_selection_description.rb
pact-1.51.1 lib/pact/pact_broker/pact_selection_description.rb
pact-1.51.0 lib/pact/pact_broker/pact_selection_description.rb
pact-1.50.1 lib/pact/pact_broker/pact_selection_description.rb
pact-1.50.0 lib/pact/pact_broker/pact_selection_description.rb
pact-1.49.3 lib/pact/pact_broker/pact_selection_description.rb