Sha256: 808e471f69c5f6c6c944316056c2c19305d4aa8ef874b9532bed98c5c81a76c9

Contents?: true

Size: 674 Bytes

Versions: 11

Compression:

Stored size: 674 Bytes

Contents

module PactBroker
  module Api
    module Paths
      PACT_BADGE_PATH =         %r{^/pacts/provider/[^/]+/consumer/.*/badge(?:\.[A-Za-z]+)?$}.freeze
      MATRIX_BADGE_PATH =       %r{^/matrix/provider/[^/]+/latest/[^/]+/consumer/[^/]+/latest/[^/]+/badge(?:\.[A-Za-z]+)?$}.freeze
      CAN_I_DEPLOY_BADGE_PATH = %r{^/pacticipants/[^/]+/latest-version/[^/]+/can-i-deploy/to/[^/]+/badge(?:\.[A-Za-z]+)?$}.freeze

      extend self

      def is_badge_path?(path)
        # Optimise by checking include? first - regexp slow
        path.include?('/badge') && (path =~ PACT_BADGE_PATH || path =~ MATRIX_BADGE_PATH || path =~ CAN_I_DEPLOY_BADGE_PATH)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
pact_broker-2.75.0 lib/pact_broker/api/paths.rb
pact_broker-2.74.1 lib/pact_broker/api/paths.rb
pact_broker-2.74.0 lib/pact_broker/api/paths.rb
pact_broker-2.73.0 lib/pact_broker/api/paths.rb
pact_broker-2.72.0 lib/pact_broker/api/paths.rb
pact_broker-2.71.0 lib/pact_broker/api/paths.rb
pact_broker-2.70.0 lib/pact_broker/api/paths.rb
pact_broker-2.69.0 lib/pact_broker/api/paths.rb
pact_broker-2.68.1 lib/pact_broker/api/paths.rb
pact_broker-2.68.0 lib/pact_broker/api/paths.rb
pact_broker-2.67.0 lib/pact_broker/api/paths.rb