Sha256: 1cc073705230845b1c51f730a89b43b1ea291a8891ef3ca0083499c895f70106

Contents?: true

Size: 1.06 KB

Versions: 36

Compression:

Stored size: 1.06 KB

Contents

require "erb"

module PactBroker
  module UI
    module Helpers
      module URLHelper

        extend self

        def dashboard_url consumer_name, provider_name, base_url = ""
          "#{base_url}/dashboard/provider/#{provider_name}/consumer/#{consumer_name}"
        end

        def group_url pacticipant_name, base_url = ""
          "#{base_url}/pacticipants/#{ERB::Util.url_encode(pacticipant_name)}"
        end

        def matrix_url consumer_name, provider_name, base_url = ""
          "#{base_url}/matrix/provider/#{ERB::Util.url_encode(provider_name)}/consumer/#{ERB::Util.url_encode(consumer_name)}"
        end

        def matrix_url_for_consumer_version consumer_name, consumer_version_number, provider_name, base_url = ""
          query = {
            q:
            [
              { pacticipant: consumer_name, version: consumer_version_number },
              { pacticipant: provider_name }
            ],
            latestby: "cvpv"
          }
          "#{base_url}/matrix?" + Rack::Utils.build_nested_query(query)
        end
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

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