parliament-utils 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5621a8e55189bd1d6fbba37ca9556e20699be33
|
4
|
+
data.tar.gz: dd6c025a5f139e131f0d7deb787655c0691cbdb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4851a595427733248ff294d304eec8108300bd98c97a362ec98e786e23b8624bc35bf37a186d3316d7a68724f62ef6359190da88d68ecacc1ff2451afa1ed58c
|
7
|
+
data.tar.gz: 23547f2af26403b52671ac10078b8d64842fa2d0dc288bf79b38aee0adfdced7da985e40c42fa750df065072e3cfa57223c5fd288098249a9bf78947a0b16398
|
data/.gitignore
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
if ENV['AIRBRAKE_PROJECT_ID'].present? && ENV['AIRBRAKE_PROJECT_KEY'].present?
|
1
|
+
if defined?(Airbrake) && ENV['AIRBRAKE_PROJECT_ID'].present? && ENV['AIRBRAKE_PROJECT_KEY'].present?
|
2
2
|
# Airbrake is an online tool that provides robust exception tracking in your Rails
|
3
3
|
# applications. In doing so, it allows you to easily review errors, tie an error
|
4
4
|
# to an individual piece of code, and trace the cause back to recent
|
@@ -116,6 +116,11 @@ module Parliament
|
|
116
116
|
Pugin.alternates = alternates
|
117
117
|
end
|
118
118
|
|
119
|
+
# Populates @app_insights_request_id if present
|
120
|
+
def populate_request_id
|
121
|
+
@app_insights_request_id = request.env['ApplicationInsights.request.id']
|
122
|
+
end
|
123
|
+
|
119
124
|
private
|
120
125
|
|
121
126
|
# Before every request, reset Pugin's list of alternates to prevent showing rel-alternate tags on pages without data
|
@@ -5,9 +5,9 @@ module Parliament
|
|
5
5
|
module Utils
|
6
6
|
module Helpers
|
7
7
|
module ParliamentHelper
|
8
|
-
def self.parliament_request(request_number
|
8
|
+
def self.parliament_request(request_id = nil, request_number = 1)
|
9
9
|
headers = {'Ocp-Apim-Subscription-Key' => ENV['PARLIAMENT_AUTH_TOKEN'] }
|
10
|
-
headers['Request-Id'] = "#{
|
10
|
+
headers['Request-Id'] = "#{request_id}#{request_number}" if request_id
|
11
11
|
|
12
12
|
Parliament::Request::UrlRequest.new(
|
13
13
|
builder: Parliament::Builder::NTripleResponseBuilder,
|
@@ -16,8 +16,8 @@ module Parliament
|
|
16
16
|
)
|
17
17
|
end
|
18
18
|
|
19
|
-
def parliament_request(request_number
|
20
|
-
Parliament::Utils::Helpers::ParliamentHelper.parliament_request(request_number)
|
19
|
+
def parliament_request(request_id = nil, request_number = 1)
|
20
|
+
Parliament::Utils::Helpers::ParliamentHelper.parliament_request(request_id, request_number)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|