parliament-utils 0.8.1 → 0.8.2

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: a051cb11537b231b277ebd5e726d610960d30691
4
- data.tar.gz: f681e82c529a044415df651ee97ff2af35bea0a4
3
+ metadata.gz: c6b4ce12878d5fe1c90e193a370f0a917729fec0
4
+ data.tar.gz: d0f85799c92f964fbc43a5fe447f4904af47bbac
5
5
  SHA512:
6
- metadata.gz: 02edb0072127c6fcd4a3666d243369099af4b8282e1e2647bd09d5d6fbc44eb59642b9266660b03048c058fe93ef4404feb13b8990ee5bfa7a54c2913bf6c8dd
7
- data.tar.gz: 4168e3d2a5bbf1a2ad8e07a70a8e3d0d03772ddda54fb8c240052c290edd793e955ef2a8e300c505af25726e40dacb5005157086d0a0d18b32b9f7e08ae25287
6
+ metadata.gz: 1d9525cff15f63470678d51a9b3c5329af8526b9554105ec9bc1d2385fc01ba7341c895ee603f45934500fe38ce4463f1ade1ba920e917d18c79df01854cc0eb
7
+ data.tar.gz: 6ee4c3d99fd68d9f9165b810365b78e8b9f6c8155d70a0abeab7bfab8f9384e290c4af47ae054eb159b97ac9a9c4ed52e18091b6fef983b1a3b2685cbe914566
@@ -5,16 +5,19 @@ module Parliament
5
5
  module Utils
6
6
  module Helpers
7
7
  module ParliamentHelper
8
- def self.parliament_request
8
+ def self.parliament_request(request_number: 1)
9
+ headers = {'Ocp-Apim-Subscription-Key' => ENV['PARLIAMENT_AUTH_TOKEN'] }
10
+ headers['Request-Id'] = "#{ENV['ApplicationInsights.request.id']}#{request_number}" if ENV['ApplicationInsights.request.id']
11
+
9
12
  Parliament::Request::UrlRequest.new(
10
- builder: Parliament::Builder::NTripleResponseBuilder,
11
- headers: { 'Ocp-Apim-Subscription-Key': ENV['PARLIAMENT_AUTH_TOKEN'] },
12
- decorators: Parliament::Grom::Decorator
13
+ builder: Parliament::Builder::NTripleResponseBuilder,
14
+ headers: headers,
15
+ decorators: Parliament::Grom::Decorator
13
16
  )
14
17
  end
15
18
 
16
- def parliament_request
17
- Parliament::Utils::Helpers::ParliamentHelper.parliament_request
19
+ def parliament_request(request_number: 1)
20
+ Parliament::Utils::Helpers::ParliamentHelper.parliament_request(request_number)
18
21
  end
19
22
  end
20
23
  end
@@ -24,8 +24,7 @@ module Parliament
24
24
  #
25
25
  # @return [Parliament::Response]
26
26
  def self.filter_response_data(request, *filters)
27
- response = request.get
28
- response.filter(*filters)
27
+ request.get.filter(*filters)
29
28
  end
30
29
 
31
30
  # Returns the base namespace used for filtering parliamentary data within sparql queries
@@ -1,5 +1,5 @@
1
1
  module Parliament
2
2
  module Utils
3
- VERSION = '0.8.1'.freeze
3
+ VERSION = '0.8.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parliament-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rebecca Appleyard
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-01 00:00:00.000000000 Z
11
+ date: 2018-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parliament-ruby