qa 5.4.0 → 5.5.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
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73811a2b2371ead4042bab0a11e4b4b0f496e94eb6e92a2f6ddb550ac90f9d41
|
4
|
+
data.tar.gz: a8888e0db1aa46b562eaab6d45be5fd0de8df52ac9753189416a3ca0fc0d44a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4aaecb73516d38ddca2ed4dc61571aa1c70fc4fdedee75d4aa1a7763193147303b97124d4e858471508f09ba6adb6158fb63111c5f2ca817d4cf4ec7164690f
|
7
|
+
data.tar.gz: 9446f03eeaad6aa21890f97d4def246a6915f932f83b764a1bea2b6c9a818c8eb43c45f5d3b8b8235cd57d1efc59c4c08caab93fe1ed1ab5bea65d5a690f23cf
|
@@ -26,7 +26,7 @@ module Qa::Authorities
|
|
26
26
|
def build_query_url(q)
|
27
27
|
escaped_query = ERB::Util.url_encode(q)
|
28
28
|
authority_fragment = Loc.get_url_for_authority(subauthority) + ERB::Util.url_encode(subauthority)
|
29
|
-
"
|
29
|
+
"https://id.loc.gov/search/?q=#{escaped_query}&q=#{authority_fragment}&format=json"
|
30
30
|
end
|
31
31
|
|
32
32
|
def find(id)
|
@@ -34,7 +34,7 @@ module Qa::Authorities
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def find_url(id)
|
37
|
-
"
|
37
|
+
"https://id.loc.gov/authorities/#{@subauthority}/#{id}.json"
|
38
38
|
end
|
39
39
|
|
40
40
|
private
|
@@ -70,18 +70,18 @@ module Qa::Authorities::LocSubauthority
|
|
70
70
|
private
|
71
71
|
|
72
72
|
def vocab_base_url
|
73
|
-
"cs%
|
73
|
+
"cs%3Ahttps%3A%2F%2Fid.loc.gov%2Fvocabulary%2F"
|
74
74
|
end
|
75
75
|
|
76
76
|
def authority_base_url
|
77
|
-
"cs%
|
77
|
+
"cs%3Ahttps%3A%2F%2Fid.loc.gov%2Fauthorities%2F"
|
78
78
|
end
|
79
79
|
|
80
80
|
def datatype_base_url
|
81
|
-
"cs%
|
81
|
+
"cs%3Ahttps%3A%2F%2Fid.loc.gov%2Fdatatypes%2F"
|
82
82
|
end
|
83
83
|
|
84
84
|
def vocab_preservation_base_url
|
85
|
-
"cs%
|
85
|
+
"cs%3Ahttps%3A%2F%2Fid.loc.gov%2Fvocabulary%2Fpreservation%2F"
|
86
86
|
end
|
87
87
|
end
|
data/lib/qa/version.rb
CHANGED
@@ -82,7 +82,7 @@ describe Qa::TermsController, type: :controller do
|
|
82
82
|
|
83
83
|
context "loc" do
|
84
84
|
before do
|
85
|
-
stub_request(:get, "
|
85
|
+
stub_request(:get, "https://id.loc.gov/search/?format=json&q=Berry&q=cs:https://id.loc.gov/authorities/names")
|
86
86
|
.with(headers: { 'Accept' => 'application/json' })
|
87
87
|
.to_return(body: webmock_fixture("loc-names-response.txt"), status: 200)
|
88
88
|
end
|
@@ -188,7 +188,7 @@ describe Qa::TermsController, type: :controller do
|
|
188
188
|
describe "#show" do
|
189
189
|
context "with supported authorities" do
|
190
190
|
before do
|
191
|
-
stub_request(:get, "
|
191
|
+
stub_request(:get, "https://id.loc.gov/authorities/subjects/sh85077565.json")
|
192
192
|
.with(headers: { 'Accept' => 'application/json' })
|
193
193
|
.to_return(status: 200, body: webmock_fixture("loc-names-response.txt"), headers: {})
|
194
194
|
end
|
@@ -28,14 +28,14 @@ describe Qa::Authorities::Loc do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
context "for searching" do
|
31
|
-
let(:url) { '
|
31
|
+
let(:url) { 'https://id.loc.gov/search/?q=foo&q=cs%3Ahttps%3A%2F%2Fid.loc.gov%2Fauthorities%2Fsubjects&format=json' }
|
32
32
|
it "returns a url" do
|
33
33
|
expect(authority.build_query_url("foo")).to eq(url)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
context "for returning single terms" do
|
38
|
-
let(:url) { "
|
38
|
+
let(:url) { "https://id.loc.gov/authorities/subjects/sh2002003586.json" }
|
39
39
|
it "returns a url with an authority and id" do
|
40
40
|
expect(authority.find_url("sh2002003586")).to eq(url)
|
41
41
|
end
|
@@ -49,15 +49,15 @@ describe Qa::Authorities::Loc do
|
|
49
49
|
end
|
50
50
|
|
51
51
|
before do
|
52
|
-
stub_request(:get, "
|
52
|
+
stub_request(:get, "https://id.loc.gov/search/?format=json&q=cs:https://id.loc.gov/authorities/subjects")
|
53
53
|
.with(headers: { 'Accept' => 'application/json' })
|
54
54
|
.to_return(status: 200, body: "")
|
55
55
|
end
|
56
56
|
|
57
57
|
context "with flat params encoded" do
|
58
|
-
let(:url) { '
|
58
|
+
let(:url) { 'https://id.loc.gov/search/?q=foo&q=cs%3Ahttps%3A%2F%2Fid.loc.gov%2Fauthorities%2Fsubjects&format=json' }
|
59
59
|
it "returns a response" do
|
60
|
-
flat_params_url = "
|
60
|
+
flat_params_url = "https://id.loc.gov/search/?format=json&q=foo&q=cs%3Ahttps%3A%2F%2Fid.loc.gov%2Fauthorities%2Fsubjects"
|
61
61
|
expect(subject.env.url.to_s).to eq(flat_params_url)
|
62
62
|
end
|
63
63
|
end
|
@@ -66,7 +66,7 @@ describe Qa::Authorities::Loc do
|
|
66
66
|
describe "#search" do
|
67
67
|
context "any LOC authorities" do
|
68
68
|
let :authority do
|
69
|
-
stub_request(:get, "
|
69
|
+
stub_request(:get, "https://id.loc.gov/search/?format=json&q=s&q=cs:https://id.loc.gov/vocabulary/geographicAreas")
|
70
70
|
.with(headers: { 'Accept' => 'application/json' })
|
71
71
|
.to_return(body: webmock_fixture("loc-response.txt"), status: 200)
|
72
72
|
described_class.subauthority_for("geographicAreas")
|
@@ -95,7 +95,7 @@ describe Qa::Authorities::Loc do
|
|
95
95
|
|
96
96
|
context "subject terms" do
|
97
97
|
let :results do
|
98
|
-
stub_request(:get, "
|
98
|
+
stub_request(:get, "https://id.loc.gov/search/?format=json&q=History--&q=cs:https://id.loc.gov/authorities/subjects")
|
99
99
|
.with(headers: { 'Accept' => 'application/json' })
|
100
100
|
.to_return(body: webmock_fixture("loc-subjects-response.txt"), status: 200)
|
101
101
|
described_class.subauthority_for("subjects").search("History--")
|
@@ -111,7 +111,7 @@ describe Qa::Authorities::Loc do
|
|
111
111
|
|
112
112
|
context "name terms" do
|
113
113
|
let :results do
|
114
|
-
stub_request(:get, "
|
114
|
+
stub_request(:get, "https://id.loc.gov/search/?format=json&q=Berry&q=cs:https://id.loc.gov/authorities/names")
|
115
115
|
.with(headers: { 'Accept' => 'application/json' })
|
116
116
|
.to_return(body: webmock_fixture("loc-names-response.txt"), status: 200)
|
117
117
|
described_class.subauthority_for("names").search("Berry")
|
@@ -125,7 +125,7 @@ describe Qa::Authorities::Loc do
|
|
125
125
|
describe "#find" do
|
126
126
|
context "using a subject id" do
|
127
127
|
let :results do
|
128
|
-
stub_request(:get, "
|
128
|
+
stub_request(:get, "https://id.loc.gov/authorities/subjects/sh2002003586.json")
|
129
129
|
.with(headers: { 'Accept' => 'application/json' })
|
130
130
|
.to_return(status: 200, body: webmock_fixture("loc-subject-find-response.txt"), headers: {})
|
131
131
|
described_class.subauthority_for("subjects").find("sh2002003586")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Anderson
|
@@ -13,10 +13,10 @@ authors:
|
|
13
13
|
- Mike Stroming
|
14
14
|
- Adam Wead
|
15
15
|
- E. Lynette Rayle
|
16
|
-
autorequire:
|
16
|
+
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
|
-
date: 2020-
|
19
|
+
date: 2020-08-13 00:00:00.000000000 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: activerecord-import
|
@@ -617,7 +617,7 @@ homepage: https://github.com/projecthydra/questioning_authority
|
|
617
617
|
licenses:
|
618
618
|
- APACHE-2
|
619
619
|
metadata: {}
|
620
|
-
post_install_message:
|
620
|
+
post_install_message:
|
621
621
|
rdoc_options: []
|
622
622
|
require_paths:
|
623
623
|
- lib
|
@@ -632,8 +632,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
632
632
|
- !ruby/object:Gem::Version
|
633
633
|
version: '0'
|
634
634
|
requirements: []
|
635
|
-
rubygems_version: 3.
|
636
|
-
signing_key:
|
635
|
+
rubygems_version: 3.0.8
|
636
|
+
signing_key:
|
637
637
|
specification_version: 4
|
638
638
|
summary: You should question your authorities.
|
639
639
|
test_files:
|