Module: PactBroker::UI::Helpers::URLHelper

Extended by:
URLHelper
Included in:
URLHelper
Defined in:
lib/pact_broker/ui/helpers/url_helper.rb

Instance Method Summary collapse

Instance Method Details

#dashboard_url(consumer_name, provider_name, base_url = "") ⇒ Object



10
11
12
# File 'lib/pact_broker/ui/helpers/url_helper.rb', line 10

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

#group_url(pacticipant_name, base_url = "") ⇒ Object



14
15
16
# File 'lib/pact_broker/ui/helpers/url_helper.rb', line 14

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

#matrix_url(consumer_name, provider_name, base_url = "") ⇒ Object



18
19
20
# File 'lib/pact_broker/ui/helpers/url_helper.rb', line 18

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

#matrix_url_for_consumer_version(consumer_name, consumer_version_number, provider_name, base_url = "") ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/pact_broker/ui/helpers/url_helper.rb', line 22

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