relaton 1.15.0 → 1.15.1
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 +4 -4
- data/docs/README.adoc +1 -3
- data/lib/relaton/db.rb +1 -1
- data/lib/relaton/registry.rb +1 -1
- data/lib/relaton/version.rb +1 -1
- data/relaton.gemspec +1 -0
- data/spec/relaton/db_spec.rb +14 -20
- data/spec/relaton/registry_spec.rb +4 -0
- data/spec/relaton_spec.rb +102 -73
- data/spec/spec_helper.rb +1 -1
- data/spec/vcr_cassetes/3gpp_tr_00_01u_umts_3_0_0.yml +8 -8
- data/spec/vcr_cassetes/api_relaton_org.yml +80 -10
- data/spec/vcr_cassetes/api_relaton_org_unavailable.yml +18 -18
- data/spec/vcr_cassetes/bsi_bs_en_iso_8848.yml +17 -17
- data/spec/vcr_cassetes/cc_dir_10005_2019.yml +2312 -17
- data/spec/vcr_cassetes/cie_001_1980.yml +8 -8
- data/spec/vcr_cassetes/doi_10_6028_nist_ir_8245.yml +7 -7
- data/spec/vcr_cassetes/ecma_6.yml +8 -8
- data/spec/vcr_cassetes/en_10160_1999.yml +6820 -33
- data/spec/vcr_cassetes/iana_service_names_port_numbers.yml +10 -10
- data/spec/vcr_cassetes/ieee_528_2019.yml +8 -8
- data/spec/vcr_cassetes/iso_111111119115_1.yml +9 -9
- data/spec/vcr_cassetes/iso_19115_1.yml +19 -19
- data/spec/vcr_cassetes/iso_19115_1_2.yml +35 -35
- data/spec/vcr_cassetes/iso_19115_all_parts.yml +18 -18
- data/spec/vcr_cassetes/iso_19133_2005.yml +15 -15
- data/spec/vcr_cassetes/iso_combined_applied.yml +33 -33
- data/spec/vcr_cassetes/iso_combined_included.yml +33 -33
- data/spec/vcr_cassetes/iso_dis.yml +18 -18
- data/spec/vcr_cassetes/ogc_19_025r1.yml +8 -8
- data/spec/vcr_cassetes/omg_ami4ccm_1_0.yml +6 -6
- data/spec/vcr_cassetes/rfc_8341.yml +13 -9
- metadata +16 -16
- data/spec/vcr_cassetes/async_fetch.yml +0 -4412
- data/spec/vcr_cassetes/bipm_i18n_async_fetch.yml +0 -618
- data/spec/vcr_cassetes/bipm_metrologia_29_6_373.yml +0 -294
- data/spec/vcr_cassetes/fisp_140.yml +0 -48
- data/spec/vcr_cassetes/gb_t_20223_2006.yml +0 -38
- data/spec/vcr_cassetes/iec_60050_102_2007.yml +0 -290
- data/spec/vcr_cassetes/iec_combined_included.yml +0 -960
- data/spec/vcr_cassetes/iho_b_11.yml +0 -74
- data/spec/vcr_cassetes/itu_combined_included.yml +0 -1348
- data/spec/vcr_cassetes/oasis_amqp_core_types_v1_0_pt1.yml +0 -84
- data/spec/vcr_cassetes/sp_800_38b.yml +0 -48
- data/spec/vcr_cassetes/threads_from_env.yml +0 -412
- data/spec/vcr_cassetes/un_rtade_cefact_2004_32.yml +0 -814
- data/spec/vcr_cassetes/w3c_json_ld11.yml +0 -233
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 92d8d26812ae600e09e7b84beb548768db73c0e0837389feb0cf55c84ec4314f
|
|
4
|
+
data.tar.gz: d7737f947638fbe5eb17456c2e41e0b1b567434db39cbbc2f0c1644378765c9a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 94b13ec45ed1b2f2313212ec1eecd5e25f60cf5017874f342100a2702b141cbb0f09bc275b34ccc1f5afbc6bbfd66f89d19febda44828f7e1f33046ee5c18fce
|
|
7
|
+
data.tar.gz: bc7c20aa21f7c7552a6cc191cce868786949939b7f66c939f69f825b887da48233ed2bde348e837c4388e37164d858edcd6e06702376063d690086872f8011e9
|
data/docs/README.adoc
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
= Relaton
|
|
2
2
|
|
|
3
3
|
image:https://img.shields.io/gem/v/relaton.svg["Gem Version", link="https://rubygems.org/gems/relaton"]
|
|
4
|
-
image:https://github.com/relaton/relaton/workflows/
|
|
5
|
-
image:https://github.com/relaton/relaton/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/relaton/relaton/actions?workflow=windows"]
|
|
6
|
-
image:https://github.com/relaton/relaton/workflows/ubuntu/badge.svg["Build Status (Ubuntu)", link="https://github.com/relaton/relaton/actions?workflow=ubuntu"]
|
|
4
|
+
image:https://github.com/relaton/relaton/workflows/rake/badge.svg["Build Status", link="https://github.com/relaton/relaton/actions?workflow=rake"]
|
|
7
5
|
image:https://codeclimate.com/github/relaton/relaton/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/relaton/relaton"]
|
|
8
6
|
image:https://img.shields.io/github/issues-pr-raw/relaton/relaton.svg["Pull Requests", link="https://github.com/relaton/relaton/pulls"]
|
|
9
7
|
image:https://img.shields.io/github/commits-since/relaton/relaton/latest.svg["Commits since latest",link="https://github.com/relaton/relaton/releases"]
|
data/lib/relaton/db.rb
CHANGED
|
@@ -110,7 +110,7 @@ module Relaton
|
|
|
110
110
|
Util.log "[relaton] ERROR: #{args[0]} -- #{e.message}", :error
|
|
111
111
|
args[3].call nil
|
|
112
112
|
end
|
|
113
|
-
@queues[stdclass] = { queue:
|
|
113
|
+
@queues[stdclass] = { queue: SizedQueue.new(threads * 2), workers_pool: wp }
|
|
114
114
|
Thread.new { process_queue @queues[stdclass] }
|
|
115
115
|
end
|
|
116
116
|
@queues[stdclass][:queue] << [ref, year, opts, block]
|
data/lib/relaton/registry.rb
CHANGED
|
@@ -9,7 +9,7 @@ module Relaton
|
|
|
9
9
|
relaton_gb relaton_iec relaton_ietf relaton_iso relaton_itu relaton_nist
|
|
10
10
|
relaton_ogc relaton_calconnect relaton_omg relaton_un relaton_w3c
|
|
11
11
|
relaton_ieee relaton_iho relaton_bipm relaton_ecma relaton_cie relaton_bsi
|
|
12
|
-
relaton_cen relaton_iana relaton_3gpp relaton_oasis relaton_doi
|
|
12
|
+
relaton_cen relaton_iana relaton_3gpp relaton_oasis relaton_doi relaton_jis
|
|
13
13
|
].freeze
|
|
14
14
|
|
|
15
15
|
include Singleton
|
data/lib/relaton/version.rb
CHANGED
data/relaton.gemspec
CHANGED
|
@@ -45,6 +45,7 @@ Gem::Specification.new do |spec|
|
|
|
45
45
|
spec.add_dependency "relaton-iho", "~> 1.14.0"
|
|
46
46
|
spec.add_dependency "relaton-iso", "~> 1.15.0"
|
|
47
47
|
spec.add_dependency "relaton-itu", "~> 1.14.0"
|
|
48
|
+
spec.add_dependency "relaton-jis", "~> 1.14.0"
|
|
48
49
|
spec.add_dependency "relaton-nist", "~> 1.14.0"
|
|
49
50
|
spec.add_dependency "relaton-oasis", "~> 1.14.0"
|
|
50
51
|
spec.add_dependency "relaton-ogc", "~> 1.14.0"
|
data/spec/relaton/db_spec.rb
CHANGED
|
@@ -8,6 +8,7 @@ RSpec.describe Relaton::Db do
|
|
|
8
8
|
it "create bibitem from YAML content" do
|
|
9
9
|
h = { "docid" => [{ "id" => "ISO 123", type: "ISO", "primary" => true }] }
|
|
10
10
|
expect(YAML).to receive(:safe_load).with(:content).and_return h
|
|
11
|
+
allow(YAML).to receive(:safe_load).and_call_original
|
|
11
12
|
item = subject.send :search_edition_year, "iso/item.yaml", :content, nil, nil
|
|
12
13
|
expect(item).to be_instance_of RelatonIsoBib::IsoBibliographicItem
|
|
13
14
|
end
|
|
@@ -203,33 +204,27 @@ RSpec.describe Relaton::Db do
|
|
|
203
204
|
"ITU-T Y.1911", "ITU-T Y.2012", "ITU-T Y.2206", "ITU-T O.172",
|
|
204
205
|
"ITU-T G.780/Y.1351", "ITU-T G.711", "ITU-T G.1011"]
|
|
205
206
|
results = []
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
end
|
|
210
|
-
Timeout.timeout(60) { refs.size.times { results << queue.pop } }
|
|
207
|
+
refs.each do |ref|
|
|
208
|
+
expect(db).to receive(:fetch).with(ref, nil, {}).and_return :result
|
|
209
|
+
db.fetch_async(ref) { |r| queue << [r, ref] }
|
|
211
210
|
end
|
|
211
|
+
Timeout.timeout(60) { refs.size.times { results << queue.pop } }
|
|
212
212
|
results.each do |result|
|
|
213
|
-
expect(result[0]).to
|
|
213
|
+
expect(result[0]).to be :result
|
|
214
214
|
end
|
|
215
215
|
end
|
|
216
216
|
|
|
217
217
|
it "BIPM i18n" do
|
|
218
|
-
expect(File).to receive(:exist?).with(/index\.yaml/).and_return false
|
|
219
|
-
allow(File).to receive(:exist?).and_call_original
|
|
220
|
-
# refs = ["CGPM Resolution 1889-00", "CGPM Résolution 1889-00",
|
|
221
|
-
# "CGPM Réunion 9", "CGPM Meeting 9"]
|
|
222
218
|
refs = ["CGPM -- Resolution (1889)", "CGPM -- Résolution (1889)",
|
|
223
219
|
"CGPM -- Réunion 9 (1948)", "CGPM -- Meeting 9 (1948)"]
|
|
224
220
|
results = []
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
end
|
|
229
|
-
Timeout.timeout(60) { refs.size.times { results << queue.pop } }
|
|
221
|
+
refs.each do |ref|
|
|
222
|
+
expect(db).to receive(:fetch).with(ref, nil, {}).and_return :result
|
|
223
|
+
db.fetch_async(ref) { |r| queue << [r, ref] }
|
|
230
224
|
end
|
|
225
|
+
Timeout.timeout(60) { refs.size.times { results << queue.pop } }
|
|
231
226
|
results.each do |result|
|
|
232
|
-
expect(result[0]).to
|
|
227
|
+
expect(result[0]).to be :result
|
|
233
228
|
end
|
|
234
229
|
end
|
|
235
230
|
|
|
@@ -262,10 +257,9 @@ RSpec.describe Relaton::Db do
|
|
|
262
257
|
expect(ENV).to receive(:[]).with("RELATON_FETCH_PARALLEL").and_return(1)
|
|
263
258
|
allow(ENV).to receive(:[]).and_call_original
|
|
264
259
|
expect(Relaton::WorkersPool).to receive(:new).with(1).and_call_original
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
end
|
|
260
|
+
expect(db).to receive(:fetch).with("ITU-T G.993.5", nil, {})
|
|
261
|
+
db.fetch_async("ITU-T G.993.5") { |r| queue << r }
|
|
262
|
+
Timeout.timeout(50) { queue.pop }
|
|
269
263
|
end
|
|
270
264
|
end
|
|
271
265
|
end
|
|
@@ -105,6 +105,10 @@ RSpec.describe Relaton::Registry do
|
|
|
105
105
|
expect(Relaton::Registry.instance.by_type("DOI")).to be_instance_of RelatonDoi::Processor
|
|
106
106
|
expect(Relaton::Registry.instance.processor_by_ref("doi:10.1000/182")).to be_instance_of RelatonDoi::Processor
|
|
107
107
|
end
|
|
108
|
+
|
|
109
|
+
it "JIS" do
|
|
110
|
+
expect(Relaton::Registry.instance.by_type("JIS")).to be_instance_of RelatonJis::Processor
|
|
111
|
+
end
|
|
108
112
|
end
|
|
109
113
|
|
|
110
114
|
it "find processot by dataset" do
|
data/spec/relaton_spec.rb
CHANGED
|
@@ -68,41 +68,40 @@ RSpec.describe Relaton::Db do
|
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
context "IEC" do
|
|
71
|
+
before do
|
|
72
|
+
docid = RelatonBib::DocumentIdentifier.new(id: "IEC 60050-102:2007", type: "IEC")
|
|
73
|
+
item = RelatonIec::IecBibliographicItem.new docid: [docid]
|
|
74
|
+
expect(RelatonIec::IecBibliography).to receive(:get).with("IEC 60050-102:2007", nil, {}).and_return item
|
|
75
|
+
end
|
|
76
|
+
|
|
71
77
|
it "get by reference" do
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
expect(bib.docidentifier[0].id).to eq "IEC 60050-102:2007"
|
|
75
|
-
end
|
|
78
|
+
bib = @db.fetch "IEC 60050-102:2007"
|
|
79
|
+
expect(bib.docidentifier[0].id).to eq "IEC 60050-102:2007"
|
|
76
80
|
end
|
|
77
81
|
|
|
78
82
|
it "get by URN" do
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
expect(bib.docidentifier[0].id).to eq "IEC 60050-102:2007"
|
|
82
|
-
end
|
|
83
|
+
bib = @db.fetch "urn:iec:std:iec:60050-102:2007:::"
|
|
84
|
+
expect(bib.docidentifier[0].id).to eq "IEC 60050-102:2007"
|
|
83
85
|
end
|
|
84
86
|
end
|
|
85
87
|
|
|
86
88
|
context "NIST references" do
|
|
87
|
-
before(:each) do
|
|
88
|
-
nist_fr = /\.relaton\/nist\/pubs-export\.zip/
|
|
89
|
-
expect(File).to receive(:exist?).with(nist_fr).and_return false
|
|
90
|
-
expect(File).to receive(:exist?).and_call_original.at_least :once
|
|
91
|
-
# expect(FileUtils).to receive(:mv).with kind_of(String), nist_fr
|
|
92
|
-
end
|
|
93
|
-
|
|
94
89
|
it "gets FISP" do
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
90
|
+
docid = RelatonBib::DocumentIdentifier.new(id: "NIST FIPS 140", type: "NIST")
|
|
91
|
+
item = RelatonNist::NistBibliographicItem.new docid: [docid]
|
|
92
|
+
expect(RelatonNist::NistBibliography).to receive(:get).with("NIST FIPS 140", nil, {}).and_return item
|
|
93
|
+
bib = @db.fetch "NIST FIPS 140"
|
|
94
|
+
expect(bib).to be_instance_of RelatonNist::NistBibliographicItem
|
|
95
|
+
expect(bib.docidentifier[0].id).to eq "NIST FIPS 140"
|
|
99
96
|
end
|
|
100
97
|
|
|
101
98
|
it "gets SP" do
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
docid = RelatonBib::DocumentIdentifier.new(id: "NIST SP 800-38B", type: "NIST")
|
|
100
|
+
item = RelatonNist::NistBibliographicItem.new docid: [docid]
|
|
101
|
+
expect(RelatonNist::NistBibliography).to receive(:get).with("NIST SP 800-38B", nil, {}).and_return item
|
|
102
|
+
bib = @db.fetch "NIST SP 800-38B"
|
|
103
|
+
expect(bib).to be_instance_of RelatonNist::NistBibliographicItem
|
|
104
|
+
expect(bib.docidentifier[0].id).to eq "NIST SP 800-38B"
|
|
106
105
|
end
|
|
107
106
|
end
|
|
108
107
|
|
|
@@ -244,17 +243,21 @@ RSpec.describe Relaton::Db do
|
|
|
244
243
|
end
|
|
245
244
|
|
|
246
245
|
it "get UN reference" do
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
246
|
+
docid = RelatonBib::DocumentIdentifier.new(id: "UN TRADE/CEFACT/2004/32", type: "UN")
|
|
247
|
+
item = RelatonUn::UnBibliographicItem.new docid: [docid], session: RelatonUn::Session.new(session_number: "1")
|
|
248
|
+
expect(RelatonUn::UnBibliography).to receive(:get).with("UN TRADE/CEFACT/2004/32", nil, {}).and_return item
|
|
249
|
+
bib = @db.fetch "UN TRADE/CEFACT/2004/32", nil, {}
|
|
250
|
+
expect(bib).to be_instance_of RelatonUn::UnBibliographicItem
|
|
251
|
+
expect(bib.docidentifier.first.id).to eq "UN TRADE/CEFACT/2004/32"
|
|
251
252
|
end
|
|
252
253
|
|
|
253
254
|
it "get W3C reference" do
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
255
|
+
docid = RelatonBib::DocumentIdentifier.new(id: "W3C REC-json-ld11-20200716", type: "W3C")
|
|
256
|
+
item = RelatonW3c::W3cBibliographicItem.new docid: [docid]
|
|
257
|
+
expect(RelatonW3c::W3cBibliography).to receive(:get).with("W3C REC-json-ld11-20200716", nil, {}).and_return item
|
|
258
|
+
bib = @db.fetch "W3C REC-json-ld11-20200716", nil, {}
|
|
259
|
+
expect(bib).to be_instance_of RelatonW3c::W3cBibliographicItem
|
|
260
|
+
expect(bib.docidentifier.first.id).to eq "W3C REC-json-ld11-20200716"
|
|
258
261
|
end
|
|
259
262
|
|
|
260
263
|
it "get IEEE reference" do
|
|
@@ -265,10 +268,12 @@ RSpec.describe Relaton::Db do
|
|
|
265
268
|
end
|
|
266
269
|
|
|
267
270
|
it "get IHO reference" do
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
271
|
+
docid = RelatonBib::DocumentIdentifier.new(id: "IHO B-11", type: "IHO")
|
|
272
|
+
item = RelatonIho::IhoBibliographicItem.new docid: [docid]
|
|
273
|
+
expect(RelatonIho::IhoBibliography).to receive(:get).with("IHO B-11", nil, {}).and_return item
|
|
274
|
+
bib = @db.fetch "IHO B-11"
|
|
275
|
+
expect(bib).to be_instance_of RelatonIho::IhoBibliographicItem
|
|
276
|
+
expect(bib.docidentifier.first.id).to eq "IHO B-11"
|
|
272
277
|
end
|
|
273
278
|
|
|
274
279
|
it "get ECMA reference" do
|
|
@@ -314,15 +319,20 @@ RSpec.describe Relaton::Db do
|
|
|
314
319
|
end
|
|
315
320
|
|
|
316
321
|
it "get OASIS reference" do
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
322
|
+
docid = RelatonBib::DocumentIdentifier.new(id: "OASIS amqp-core-types-v1.0-Pt1", type: "OASIS")
|
|
323
|
+
item = RelatonOasis::OasisBibliographicItem.new docid: [docid]
|
|
324
|
+
expect(RelatonOasis::OasisBibliography).to receive(:get).with("OASIS amqp-core-types-v1.0-Pt1", nil, {}).and_return item
|
|
325
|
+
bib = @db.fetch "OASIS amqp-core-types-v1.0-Pt1"
|
|
326
|
+
expect(bib).to be_instance_of RelatonOasis::OasisBibliographicItem
|
|
321
327
|
end
|
|
322
328
|
|
|
323
|
-
it "get BIPM reference"
|
|
329
|
+
it "get BIPM reference" do
|
|
330
|
+
docid = RelatonBib::DocumentIdentifier.new(id: "BIPM Metrologia 29 6 373", type: "BIPM")
|
|
331
|
+
item = RelatonBipm::BipmBibliographicItem.new docid: [docid]
|
|
332
|
+
expect(RelatonBipm::BipmBibliography).to receive(:get).with("BIPM Metrologia 29 6 373", nil, {}).and_return item
|
|
324
333
|
bib = @db.fetch "BIPM Metrologia 29 6 373"
|
|
325
334
|
expect(bib).to be_instance_of RelatonBipm::BipmBibliographicItem
|
|
335
|
+
expect(bib.docidentifier.first.id).to eq "BIPM Metrologia 29 6 373"
|
|
326
336
|
end
|
|
327
337
|
|
|
328
338
|
it "get DOI reference", vcr: "doi_10_6028_nist_ir_8245" do
|
|
@@ -359,49 +369,68 @@ RSpec.describe Relaton::Db do
|
|
|
359
369
|
|
|
360
370
|
context "IEC" do
|
|
361
371
|
it "included" do
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
372
|
+
item = RelatonIec::IecBibliographicItem.new docid: [RelatonBib::DocumentIdentifier.new(id: "IEC 60027-1", type: "IEC")]
|
|
373
|
+
expect(RelatonIec::IecBibliography).to receive(:get).with("IEC 60027-1", nil, {}).and_return item
|
|
374
|
+
item1 = RelatonIec::IecBibliographicItem.new docid: [RelatonBib::DocumentIdentifier.new(id: "IEC 60027-1/AMD1:1997", type: "IEC")]
|
|
375
|
+
expect(RelatonIec::IecBibliography).to receive(:get).with("IEC 60027-1/Amd 1", nil, {}).and_return item1
|
|
376
|
+
item2 = RelatonIec::IecBibliographicItem.new docid: [RelatonBib::DocumentIdentifier.new(id: "IEC 60027-1/AMD2:2005", type: "IEC")]
|
|
377
|
+
expect(RelatonIec::IecBibliography).to receive(:get).with("IEC 60027-1/Amd 2", nil, {}).and_return item2
|
|
378
|
+
bib = @db.fetch "IEC 60027-1, Amd 1, Amd 2"
|
|
379
|
+
expect(bib.docidentifier[0].id).to eq "IEC 60027-1, Amd 1, Amd 2"
|
|
380
|
+
expect(bib.relation[0].type).to eq "updates"
|
|
381
|
+
expect(bib.relation[0].bibitem.docidentifier[0].id).to eq "IEC 60027-1"
|
|
382
|
+
expect(bib.relation[1].type).to eq "complements"
|
|
383
|
+
expect(bib.relation[1].description.content).to eq "amendment"
|
|
384
|
+
expect(bib.relation[1].bibitem.docidentifier[0].id).to eq "IEC 60027-1/AMD1:1997"
|
|
385
|
+
expect(bib.relation[2].type).to eq "complements"
|
|
386
|
+
expect(bib.relation[2].description.content).to eq "amendment"
|
|
387
|
+
expect(bib.relation[2].bibitem.docidentifier[0].id).to eq "IEC 60027-1/AMD2:2005"
|
|
374
388
|
end
|
|
375
389
|
end
|
|
376
390
|
|
|
377
391
|
context "ITU" do
|
|
378
392
|
it "included" do
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
393
|
+
docid = RelatonBib::DocumentIdentifier.new(id: "ITU-T G.989.2", type: "ITU")
|
|
394
|
+
group = RelatonItu::ItuGroup.new(name: "Group")
|
|
395
|
+
ed = RelatonItu::EditorialGroup.new(bureau: "Bureau", group: group)
|
|
396
|
+
item = RelatonItu::ItuBibliographicItem.new docid: [docid], editorialgroup: ed
|
|
397
|
+
expect(RelatonItu::ItuBibliography).to receive(:get).with("ITU-T G.989.2", nil, {}).and_return item
|
|
398
|
+
docid1 = RelatonBib::DocumentIdentifier.new(id: "ITU-T G.989.2 Amd 1", type: "ITU")
|
|
399
|
+
item1 = RelatonItu::ItuBibliographicItem.new docid: [docid1], editorialgroup: ed
|
|
400
|
+
expect(RelatonItu::ItuBibliography).to receive(:get).with("ITU-T G.989.2 Amd 1", nil, {}).and_return item1
|
|
401
|
+
docid2 = RelatonBib::DocumentIdentifier.new(id: "ITU-T G.989.2 Amd 2", type: "ITU")
|
|
402
|
+
item2 = RelatonItu::ItuBibliographicItem.new docid: [docid2], editorialgroup: ed
|
|
403
|
+
expect(RelatonItu::ItuBibliography).to receive(:get).with("ITU-T G.989.2 Amd 2", nil, {}).and_return item2
|
|
404
|
+
bib = @db.fetch "ITU-T G.989.2, Amd 1, Amd 2"
|
|
405
|
+
expect(bib.docidentifier[0].id).to eq "ITU-T G.989.2, Amd 1, Amd 2"
|
|
406
|
+
expect(bib.relation[0].type).to eq "updates"
|
|
407
|
+
expect(bib.relation[0].bibitem.docidentifier[0].id).to eq "ITU-T G.989.2"
|
|
408
|
+
expect(bib.relation[1].type).to eq "complements"
|
|
409
|
+
expect(bib.relation[1].description.content).to eq "amendment"
|
|
410
|
+
expect(bib.relation[1].bibitem.docidentifier[0].id).to eq "ITU-T G.989.2 Amd 1"
|
|
411
|
+
expect(bib.relation[2].type).to eq "complements"
|
|
412
|
+
expect(bib.relation[2].description.content).to eq "amendment"
|
|
413
|
+
expect(bib.relation[2].bibitem.docidentifier[0].id).to eq "ITU-T G.989.2 Amd 2"
|
|
391
414
|
end
|
|
392
415
|
end
|
|
393
416
|
|
|
394
417
|
context "NIST" do
|
|
395
418
|
it "included" do
|
|
396
|
-
VCR.use_cassette "nist_combined_included" do
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
419
|
+
# VCR.use_cassette "nist_combined_included" do
|
|
420
|
+
doci = RelatonBib::DocumentIdentifier.new(id: "SP 800-38A", type: "NIST")
|
|
421
|
+
item = RelatonNist::NistBibliographicItem.new docid: [doci]
|
|
422
|
+
expect(RelatonNist::NistBibliography).to receive(:get).with("NIST SP 800-38A", nil, {}).and_return item
|
|
423
|
+
docid1 = RelatonBib::DocumentIdentifier.new(id: "SP 800-38A-Add", type: "NIST")
|
|
424
|
+
item1 = RelatonNist::NistBibliographicItem.new docid: [docid1]
|
|
425
|
+
expect(RelatonNist::NistBibliography).to receive(:get).with("NIST SP 800-38A/Add", nil, {}).and_return item1
|
|
426
|
+
bib = @db.fetch "NIST SP 800-38A, Add"
|
|
427
|
+
expect(bib.docidentifier[0].id).to eq "NIST SP 800-38A, Add"
|
|
428
|
+
expect(bib.relation[0].type).to eq "updates"
|
|
429
|
+
expect(bib.relation[0].bibitem.docidentifier[0].id).to eq "SP 800-38A"
|
|
430
|
+
expect(bib.relation[1].type).to eq "complements"
|
|
431
|
+
expect(bib.relation[1].description.content).to eq "amendment"
|
|
432
|
+
expect(bib.relation[1].bibitem.docidentifier[0].id).to eq "SP 800-38A-Add"
|
|
433
|
+
# end
|
|
405
434
|
end
|
|
406
435
|
end
|
|
407
436
|
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -23,7 +23,7 @@ http_interactions:
|
|
|
23
23
|
Connection:
|
|
24
24
|
- keep-alive
|
|
25
25
|
Content-Length:
|
|
26
|
-
- '
|
|
26
|
+
- '1571'
|
|
27
27
|
Cache-Control:
|
|
28
28
|
- max-age=300
|
|
29
29
|
Content-Security-Policy:
|
|
@@ -41,29 +41,29 @@ http_interactions:
|
|
|
41
41
|
X-Xss-Protection:
|
|
42
42
|
- 1; mode=block
|
|
43
43
|
X-Github-Request-Id:
|
|
44
|
-
-
|
|
44
|
+
- AF94:0BB8:82E1EC:C34C77:6418BDF8
|
|
45
45
|
Accept-Ranges:
|
|
46
46
|
- bytes
|
|
47
47
|
Date:
|
|
48
|
-
-
|
|
48
|
+
- Mon, 20 Mar 2023 20:11:37 GMT
|
|
49
49
|
Via:
|
|
50
50
|
- 1.1 varnish
|
|
51
51
|
X-Served-By:
|
|
52
|
-
- cache-
|
|
52
|
+
- cache-iad-kjyo7100116-IAD
|
|
53
53
|
X-Cache:
|
|
54
54
|
- MISS
|
|
55
55
|
X-Cache-Hits:
|
|
56
56
|
- '0'
|
|
57
57
|
X-Timer:
|
|
58
|
-
-
|
|
58
|
+
- S1679343097.936255,VS0,VE191
|
|
59
59
|
Vary:
|
|
60
60
|
- Authorization,Accept-Encoding,Origin
|
|
61
61
|
Access-Control-Allow-Origin:
|
|
62
62
|
- "*"
|
|
63
63
|
X-Fastly-Request-Id:
|
|
64
|
-
-
|
|
64
|
+
- baac0cdd547b3db0edeca1c739043b643f24467b
|
|
65
65
|
Expires:
|
|
66
|
-
-
|
|
66
|
+
- Mon, 20 Mar 2023 20:16:37 GMT
|
|
67
67
|
Source-Age:
|
|
68
68
|
- '0'
|
|
69
69
|
body:
|
|
@@ -147,5 +147,5 @@ http_interactions:
|
|
|
147
147
|
freeze_stage3_meeting: SMG-28
|
|
148
148
|
close_meeting: SP-28
|
|
149
149
|
project_end: '1999-02-12'
|
|
150
|
-
recorded_at:
|
|
150
|
+
recorded_at: Mon, 20 Mar 2023 20:11:37 GMT
|
|
151
151
|
recorded_with: VCR 6.1.0
|
|
@@ -27,30 +27,100 @@ http_interactions:
|
|
|
27
27
|
Connection:
|
|
28
28
|
- keep-alive
|
|
29
29
|
Date:
|
|
30
|
-
-
|
|
30
|
+
- Mon, 20 Mar 2023 21:56:44 GMT
|
|
31
31
|
X-Amzn-Requestid:
|
|
32
|
-
-
|
|
32
|
+
- 6abf641e-024c-44fd-827d-f698ec0b9f98
|
|
33
33
|
Access-Control-Allow-Origin:
|
|
34
34
|
- "*"
|
|
35
35
|
Access-Control-Allow-Headers:
|
|
36
36
|
- Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token
|
|
37
37
|
X-Amz-Apigw-Id:
|
|
38
|
-
-
|
|
38
|
+
- CGZ2SEOloAMFWWg=
|
|
39
39
|
Access-Control-Allow-Methods:
|
|
40
40
|
- GET, POST, OPTIONS
|
|
41
41
|
X-Amzn-Trace-Id:
|
|
42
|
-
- Root=1-
|
|
42
|
+
- Root=1-6418d68e-4ac1249546dd5c4d25cf3f5c;Sampled=0
|
|
43
43
|
X-Cache:
|
|
44
44
|
- Miss from cloudfront
|
|
45
45
|
Via:
|
|
46
|
-
- 1.1
|
|
46
|
+
- 1.1 f394ef913737988f9bc8ebc09850a2ba.cloudfront.net (CloudFront)
|
|
47
47
|
X-Amz-Cf-Pop:
|
|
48
48
|
- ATL51-C1
|
|
49
49
|
X-Amz-Cf-Id:
|
|
50
|
-
-
|
|
50
|
+
- OLhtxFwfIuox0Cf9v4f3FuGDqppvRO3FGvbpWvxyrCbwhxFPqRrXMg==
|
|
51
51
|
body:
|
|
52
|
-
encoding:
|
|
53
|
-
string:
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
encoding: UTF-8
|
|
53
|
+
string: |-
|
|
54
|
+
<bibdata type="standard">
|
|
55
|
+
<fetched>2021-07-11</fetched>
|
|
56
|
+
<title type="title-intro" format="text/plain" language="en" script="Latn">Geographic information</title>
|
|
57
|
+
<title type="title-main" format="text/plain" language="en" script="Latn">Metadata</title>
|
|
58
|
+
<title type="title-part" format="text/plain" language="en" script="Latn">Part 2: Extensions for acquisition and processing</title>
|
|
59
|
+
<title type="main" format="text/plain" language="en" script="Latn">Geographic information - Metadata - Part 2: Extensions for acquisition and processing</title>
|
|
60
|
+
<title type="title-intro" format="text/plain" language="fr" script="Latn">Information géographique</title>
|
|
61
|
+
<title type="title-main" format="text/plain" language="fr" script="Latn">Métadonnées</title>
|
|
62
|
+
<title type="title-part" format="text/plain" language="fr" script="Latn">Partie 2: Extensions pour l'acquisition et le traitement</title>
|
|
63
|
+
<title type="main" format="text/plain" language="fr" script="Latn">Information géographique - Métadonnées - Partie 2: Extensions pour l'acquisition et le traitement</title>
|
|
64
|
+
<uri type="src">https://www.iso.org/standard/67039.html</uri>
|
|
65
|
+
<uri type="obp">https://www.iso.org/obp/ui/#!iso:std:67039:en</uri>
|
|
66
|
+
<uri type="rss">https://www.iso.org/contents/data/standard/06/70/67039.detail.rss</uri>
|
|
67
|
+
<docidentifier type="ISO">ISO 19115-2:2019</docidentifier>
|
|
68
|
+
<docidentifier type="URN">urn:iso:std:iso:19115:-2:stage-60.60:ed-2:en,fr</docidentifier>
|
|
69
|
+
<docnumber>19115</docnumber>
|
|
70
|
+
<date type="published">
|
|
71
|
+
<on>2019-01</on>
|
|
72
|
+
</date>
|
|
73
|
+
<contributor>
|
|
74
|
+
<role type="publisher"/>
|
|
75
|
+
<organization>
|
|
76
|
+
<name>International Organization for Standardization</name>
|
|
77
|
+
<abbreviation>ISO</abbreviation>
|
|
78
|
+
<uri>www.iso.org</uri>
|
|
79
|
+
</organization>
|
|
80
|
+
</contributor>
|
|
81
|
+
<edition>2</edition>
|
|
82
|
+
<language>en</language>
|
|
83
|
+
<language>fr</language>
|
|
84
|
+
<script>Latn</script>
|
|
85
|
+
<status>
|
|
86
|
+
<stage>60</stage>
|
|
87
|
+
<substage>60</substage>
|
|
88
|
+
</status>
|
|
89
|
+
<copyright>
|
|
90
|
+
<from>2019</from>
|
|
91
|
+
<owner>
|
|
92
|
+
<organization>
|
|
93
|
+
<name>ISO</name>
|
|
94
|
+
</organization>
|
|
95
|
+
</owner>
|
|
96
|
+
</copyright>
|
|
97
|
+
<relation type="obsoletes">
|
|
98
|
+
<bibitem type="standard">
|
|
99
|
+
<formattedref format="text/plain">ISO 19115-2:2009</formattedref>
|
|
100
|
+
</bibitem>
|
|
101
|
+
</relation>
|
|
102
|
+
<relation type="updates">
|
|
103
|
+
<bibitem type="standard">
|
|
104
|
+
<formattedref format="text/plain">ISO 19115-2:2019/PRF Amd 1</formattedref>
|
|
105
|
+
<date type="circulated">
|
|
106
|
+
<on>2019-01-10</on>
|
|
107
|
+
</date>
|
|
108
|
+
</bibitem>
|
|
109
|
+
</relation>
|
|
110
|
+
<place>Geneva</place>
|
|
111
|
+
<ext>
|
|
112
|
+
<doctype>international-standard</doctype>
|
|
113
|
+
<editorialgroup>
|
|
114
|
+
<technical-committee number="211" type="TC">ISO/TC 211Geographic information/Geomatics</technical-committee>
|
|
115
|
+
</editorialgroup>
|
|
116
|
+
<ics>
|
|
117
|
+
<code>35.240.70</code>
|
|
118
|
+
<text>IT applications in science</text>
|
|
119
|
+
</ics>
|
|
120
|
+
<structuredidentifier type="ISO">
|
|
121
|
+
<project-number>ISO 19115</project-number>
|
|
122
|
+
</structuredidentifier>
|
|
123
|
+
</ext>
|
|
124
|
+
</bibdata>
|
|
125
|
+
recorded_at: Mon, 20 Mar 2023 21:56:44 GMT
|
|
56
126
|
recorded_with: VCR 6.1.0
|