parliament-opensearch 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 380092882f71f2f3c548c26317db539ef9dd32889d2c9df0cadbf24ea08e44d0
|
4
|
+
data.tar.gz: dd0accac1c3e6ef7e81caaaf245481ca8171e08657715523f6a3ef3caf4260e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30b5478eab0a089b35888e1e0f412d25f4bf323d2110e1331bd1c5d28c0f37697ece7aa4b888b22aeaf2212553cab979136ea521a3f63304488260ac414be9a0
|
7
|
+
data.tar.gz: 4e54ef5523182bff03a927f0144f04614f6e421b7944f4e4e9c172968a3af0d0dceaec909984b169f10398807b12b0ed92c748769961dbec590ba5e1b28b0920
|
@@ -26,7 +26,7 @@ module Parliament
|
|
26
26
|
# @param [String] description_url the url for the OpenSearch API description file. (expected: http://example.com/description.xml - without the trailing slash).
|
27
27
|
# @param [Hash] headers the headers being sent in the request.
|
28
28
|
# @param [Parliament::OpenSearch::Builder] builder the builder required to create the response.
|
29
|
-
def initialize(description_url: nil, headers:
|
29
|
+
def initialize(description_url: nil, headers: {}, builder: nil, request_id: nil)
|
30
30
|
@description_url = description_url ||= self.class.description_url
|
31
31
|
|
32
32
|
raise Parliament::OpenSearch::DescriptionError.new(@description_url), 'No description URL passed to Parliament::OpenSearchRequest#new and, no Parliament::OpenSearchRequest#base_url value set. Without a description URL, we are unable to make any search requests.' if @description_url.nil? && self.class.templates.nil?
|
@@ -34,7 +34,7 @@ module Parliament
|
|
34
34
|
@templates = Parliament::OpenSearch::DescriptionCache.fetch(@description_url, request_id)
|
35
35
|
@open_search_parameters = self.class.open_search_parameters
|
36
36
|
|
37
|
-
super(base_url: nil, headers: headers, builder: builder)
|
37
|
+
super(base_url: nil, headers: default_headers.merge(headers), builder: builder)
|
38
38
|
end
|
39
39
|
|
40
40
|
# Sets up the query url using the base_url and parameters, then make an HTTP GET request and process results.
|
@@ -91,6 +91,17 @@ module Parliament
|
|
91
91
|
|
92
92
|
@query_url = query_url
|
93
93
|
end
|
94
|
+
|
95
|
+
# Default headers we use when performing a request
|
96
|
+
#
|
97
|
+
# @return [Hash] a hash of default headers
|
98
|
+
def default_headers
|
99
|
+
{}.tap do |hash|
|
100
|
+
hash['Accept'] = 'application/atom+xml'
|
101
|
+
hash['Ocp-Apim-Subscription-Key'] = ENV['OPENSEARCH_AUTH_TOKEN'] if ENV['OPENSEARCH_AUTH_TOKEN']
|
102
|
+
hash['Api-Version'] = ENV['PARLIAMENT_API_VERSION'] if ENV['PARLIAMENT_API_VERSION']
|
103
|
+
end
|
104
|
+
end
|
94
105
|
end
|
95
106
|
end
|
96
107
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parliament-opensearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rebecca Appleyard
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-10-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: feedjira
|
@@ -219,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
219
|
version: '0'
|
220
220
|
requirements: []
|
221
221
|
rubyforge_project:
|
222
|
-
rubygems_version: 2.6
|
222
|
+
rubygems_version: 2.7.6
|
223
223
|
signing_key:
|
224
224
|
specification_version: 4
|
225
225
|
summary: Parliamentary OpenSearch response builder
|