relaton 1.18.0 → 1.18.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/lib/relaton/db.rb +13 -2
- data/lib/relaton/version.rb +1 -1
- data/relaton.gemspec +4 -4
- data/spec/relaton/db_spec.rb +32 -0
- data/spec/relaton_spec.rb +10 -10
- data/spec/vcr_cassetes/3gpp_tr_00_01u_umts_3_0_0.yml +20 -18
- data/spec/vcr_cassetes/api_relaton_org.yml +8 -8
- data/spec/vcr_cassetes/api_relaton_org_unavailable.yml +113 -3698
- data/spec/vcr_cassetes/cc_dir_10005_2019.yml +25 -25
- data/spec/vcr_cassetes/cie_001_1980.yml +222 -200
- data/spec/vcr_cassetes/doi_10_6028_nist_ir_8245.yml +11 -12
- data/spec/vcr_cassetes/ecma_6.yml +36 -35
- data/spec/vcr_cassetes/en_10160_1999.yml +10455 -10342
- data/spec/vcr_cassetes/gb_t_20223_2006.yml +454 -1219
- data/spec/vcr_cassetes/ieee_528_2019.yml +2138 -2928
- data/spec/vcr_cassetes/iso_19115_1.yml +13522 -3945
- data/spec/vcr_cassetes/iso_19115_1_2.yml +309 -7659
- data/spec/vcr_cassetes/iso_19115_1_std.yml +13521 -3943
- data/spec/vcr_cassetes/iso_19115_all_parts.yml +197 -4195
- data/spec/vcr_cassetes/iso_19133_2005.yml +116 -3775
- data/spec/vcr_cassetes/iso_combined_applied.yml +297 -7301
- data/spec/vcr_cassetes/iso_combined_included.yml +297 -7301
- data/spec/vcr_cassetes/iso_dis.yml +126 -3332
- data/spec/vcr_cassetes/ogc_19_025r1.yml +193 -193
- data/spec/vcr_cassetes/omg_ami4ccm_1_0.yml +892 -886
- data/spec/vcr_cassetes/rfc_8341.yml +115 -106
- metadata +10 -11
- data/spec/vcr_cassetes/iso_111111119115_1.yml +0 -73
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e166e4b98b190a6286f8d6ea532e65977a901c2ff5a7f1e26f1ca1412ab92230
|
4
|
+
data.tar.gz: c07830c2b5f15bef3190b1ea07916731e8befeb9c224c6a1f4749872d8b73285
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb61c2add854d65c4113a0130f4ddd562b1bb73aa564897c665334d56dcf7645ad2a22f73a5b081a403e0ea522b22780c0a1ec9fed81905cbc5eee47ca40824e
|
7
|
+
data.tar.gz: 53633d5bde382e7c57c2af957a1b60b1dbb82fa89cd64d341271b5330c8f634cf8bd3b38527e721fc6ceae8f64fc165bfeb1ef99fb42480ad7cf47c59111ea6c
|
data/.rubocop.yml
CHANGED
data/lib/relaton/db.rb
CHANGED
@@ -447,15 +447,26 @@ module Relaton
|
|
447
447
|
bib = net_retry(code, year, opts, processor, opts.fetch(:retries, 1))
|
448
448
|
|
449
449
|
entry = check_entry(bib, stdclass, **args)
|
450
|
-
return entry if args[:db].nil?
|
450
|
+
return entry if args[:db].nil?
|
451
451
|
|
452
452
|
@semaphore.synchronize { args[:db][args[:id]] ||= entry }
|
453
|
+
args[:no_cache] ? bib_entry(bib) : entry
|
453
454
|
end
|
454
455
|
|
456
|
+
#
|
457
|
+
# If the reference isn't equal to the document identifier
|
458
|
+
# then store the document in the cache and create for the reference a redirection to the document
|
459
|
+
#
|
460
|
+
# @param [<Type>] bib <description>
|
461
|
+
# @param [<Type>] stdclass <description>
|
462
|
+
# @param [<Type>] **args <description>
|
463
|
+
#
|
464
|
+
# @return [<Type>] <description>
|
465
|
+
#
|
455
466
|
def check_entry(bib, stdclass, **args) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
456
467
|
bib_id = bib&.docidentifier&.first&.id
|
457
468
|
|
458
|
-
# when
|
469
|
+
# when ref isn't equal to bib's id then return a redirection to bib's id
|
459
470
|
if args[:db] && args[:id] && bib_id && args[:id] !~ %r{#{Regexp.quote("(#{bib_id})")}}
|
460
471
|
bid = std_id(bib.docidentifier.first.id, nil, {}, stdclass).first
|
461
472
|
@semaphore.synchronize { args[:db][bid] ||= bib_entry bib }
|
data/lib/relaton/version.rb
CHANGED
data/relaton.gemspec
CHANGED
@@ -27,11 +27,11 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.require_paths = ["lib"]
|
28
28
|
spec.files = `git ls-files`.split("\n")
|
29
29
|
# spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
30
|
-
spec.required_ruby_version = Gem::Requirement.new(">=
|
30
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
|
31
31
|
|
32
32
|
spec.add_dependency "relaton-3gpp", "~> 1.18.0"
|
33
33
|
spec.add_dependency "relaton-bipm", "~> 1.18.0"
|
34
|
-
spec.add_dependency "relaton-bsi", "~> 1.18.
|
34
|
+
spec.add_dependency "relaton-bsi", "~> 1.18.1"
|
35
35
|
spec.add_dependency "relaton-calconnect", "~> 1.18.0"
|
36
36
|
spec.add_dependency "relaton-ccsds", "~> 1.18.0"
|
37
37
|
spec.add_dependency "relaton-cen", "~> 1.18.0"
|
@@ -39,14 +39,14 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_dependency "relaton-doi", "~> 1.18.0"
|
40
40
|
spec.add_dependency "relaton-ecma", "~> 1.18.0"
|
41
41
|
spec.add_dependency "relaton-etsi", "~> 1.18.0"
|
42
|
-
spec.add_dependency "relaton-gb", "~> 1.18.
|
42
|
+
spec.add_dependency "relaton-gb", "~> 1.18.2"
|
43
43
|
spec.add_dependency "relaton-iana", "~> 1.18.0"
|
44
44
|
spec.add_dependency "relaton-iec", "~> 1.18.0"
|
45
45
|
spec.add_dependency "relaton-ieee", "~> 1.18.0"
|
46
46
|
spec.add_dependency "relaton-ietf", "~> 1.18.0"
|
47
47
|
spec.add_dependency "relaton-iho", "~> 1.18.0"
|
48
48
|
spec.add_dependency "relaton-isbn", "~> 1.18.0"
|
49
|
-
spec.add_dependency "relaton-iso", "~> 1.18.
|
49
|
+
spec.add_dependency "relaton-iso", "~> 1.18.4"
|
50
50
|
spec.add_dependency "relaton-itu", "~> 1.18.0"
|
51
51
|
spec.add_dependency "relaton-jis", "~> 1.18.0"
|
52
52
|
spec.add_dependency "relaton-nist", "~> 1.18.0"
|
data/spec/relaton/db_spec.rb
CHANGED
@@ -50,6 +50,38 @@ RSpec.describe Relaton::Db do
|
|
50
50
|
expect(subject.send(:combine_doc, code, nil, {}, :relaton_bipm)).to be_nil
|
51
51
|
end
|
52
52
|
end
|
53
|
+
|
54
|
+
context "#fetch_entry" do
|
55
|
+
let(:db_cache) { double "db_cache" }
|
56
|
+
|
57
|
+
before do
|
58
|
+
expect(subject).to receive(:net_retry).with("ISO 123", nil, {}, kind_of(RelatonIso::Processor), 1).and_return :bib
|
59
|
+
end
|
60
|
+
|
61
|
+
it "using cache" do
|
62
|
+
expect(db_cache).to receive(:[]).with("ISO(ISO 123)").and_return nil
|
63
|
+
expect(db_cache).to receive(:[]=).with("ISO(ISO 123)", :entry)
|
64
|
+
expect(subject).to receive(:check_entry).with(:bib, :relaton_iso, db: db_cache, id: "ISO(ISO 123)").and_return :entry
|
65
|
+
entry = subject.send :fetch_entry, "ISO 123", nil, {}, :relaton_iso, db: db_cache, id: "ISO(ISO 123)"
|
66
|
+
expect(entry).to be :entry
|
67
|
+
end
|
68
|
+
|
69
|
+
it "DbCache is undefined" do
|
70
|
+
expect(subject).to receive(:check_entry).with(:bib, :relaton_iso, **{}).and_return :entry
|
71
|
+
entry = subject.send :fetch_entry, "ISO 123", nil, {}, :relaton_iso
|
72
|
+
expect(entry).to be :entry
|
73
|
+
end
|
74
|
+
|
75
|
+
it "not using cache" do
|
76
|
+
expect(subject).to receive(:bib_entry).with(:bib).and_return :entry
|
77
|
+
expect(subject).to receive(:check_entry).with(
|
78
|
+
:bib, :relaton_iso, db: db_cache, id: "ISO(ISO 123)", no_cache: true
|
79
|
+
).and_return :entry
|
80
|
+
expect(db_cache).to receive(:[]).with("ISO(ISO 123)").and_return :entry
|
81
|
+
entry = subject.send :fetch_entry, "ISO 123", nil, {}, :relaton_iso, db: db_cache, id: "ISO(ISO 123)", no_cache: true
|
82
|
+
expect(entry).to be :entry
|
83
|
+
end
|
84
|
+
end
|
53
85
|
end
|
54
86
|
|
55
87
|
context "class methods" do
|
data/spec/relaton_spec.rb
CHANGED
@@ -228,14 +228,14 @@ RSpec.describe Relaton::Db do
|
|
228
228
|
end
|
229
229
|
end
|
230
230
|
|
231
|
-
it "get UN reference" do
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
end
|
231
|
+
# it "get UN reference" do
|
232
|
+
# docid = RelatonBib::DocumentIdentifier.new(id: "UN TRADE/CEFACT/2004/32", type: "UN")
|
233
|
+
# item = RelatonUn::UnBibliographicItem.new docid: [docid], session: RelatonUn::Session.new(session_number: "1")
|
234
|
+
# expect(RelatonUn::UnBibliography).to receive(:get).with("UN TRADE/CEFACT/2004/32", nil, {}).and_return item
|
235
|
+
# bib = @db.fetch "UN TRADE/CEFACT/2004/32", nil, {}
|
236
|
+
# expect(bib).to be_instance_of RelatonUn::UnBibliographicItem
|
237
|
+
# expect(bib.docidentifier.first.id).to eq "UN TRADE/CEFACT/2004/32"
|
238
|
+
# end
|
239
239
|
|
240
240
|
it "get W3C reference" do
|
241
241
|
docid = RelatonBib::DocumentIdentifier.new(id: "W3C REC-json-ld11-20200716", type: "W3C")
|
@@ -383,7 +383,7 @@ RSpec.describe Relaton::Db do
|
|
383
383
|
expect(bib.relation[0].bibitem.docidentifier[0].id).to eq "ISO 19115-1:2014"
|
384
384
|
expect(bib.relation[1].type).to eq "derivedFrom"
|
385
385
|
expect(bib.relation[1].description).to be_nil
|
386
|
-
expect(bib.relation[1].bibitem.docidentifier[0].id).to eq "ISO 19115-1:2014/Amd 1"
|
386
|
+
expect(bib.relation[1].bibitem.docidentifier[0].id).to eq "ISO 19115-1:2014/Amd 1:2018"
|
387
387
|
end
|
388
388
|
end
|
389
389
|
|
@@ -395,7 +395,7 @@ RSpec.describe Relaton::Db do
|
|
395
395
|
expect(bib.relation[0].bibitem.docidentifier[0].id).to eq "ISO 19115-1:2014"
|
396
396
|
expect(bib.relation[1].type).to eq "complements"
|
397
397
|
expect(bib.relation[1].description.content).to eq "amendment"
|
398
|
-
expect(bib.relation[1].bibitem.docidentifier[0].id).to eq "ISO 19115-1:2014/Amd 1"
|
398
|
+
expect(bib.relation[1].bibitem.docidentifier[0].id).to eq "ISO 19115-1:2014/Amd 1:2018"
|
399
399
|
end
|
400
400
|
end
|
401
401
|
end
|
@@ -39,21 +39,21 @@ http_interactions:
|
|
39
39
|
X-Xss-Protection:
|
40
40
|
- 1; mode=block
|
41
41
|
X-Github-Request-Id:
|
42
|
-
-
|
42
|
+
- 32B7:2EA234:11492F5:13552C6:6661CFCA
|
43
43
|
Accept-Ranges:
|
44
44
|
- bytes
|
45
45
|
Date:
|
46
|
-
-
|
46
|
+
- Thu, 06 Jun 2024 15:03:39 GMT
|
47
47
|
Via:
|
48
48
|
- 1.1 varnish
|
49
49
|
X-Served-By:
|
50
|
-
- cache-pdk-
|
50
|
+
- cache-pdk-katl1840035-PDK
|
51
51
|
X-Cache:
|
52
|
-
-
|
52
|
+
- MISS
|
53
53
|
X-Cache-Hits:
|
54
|
-
- '
|
54
|
+
- '0'
|
55
55
|
X-Timer:
|
56
|
-
-
|
56
|
+
- S1717686219.289272,VS0,VE217
|
57
57
|
Vary:
|
58
58
|
- Authorization,Accept-Encoding,Origin
|
59
59
|
Access-Control-Allow-Origin:
|
@@ -61,9 +61,9 @@ http_interactions:
|
|
61
61
|
Cross-Origin-Resource-Policy:
|
62
62
|
- cross-origin
|
63
63
|
X-Fastly-Request-Id:
|
64
|
-
-
|
64
|
+
- '0476792df737acd69880ee6be6c6f6e231ef9e5d'
|
65
65
|
Expires:
|
66
|
-
-
|
66
|
+
- Thu, 06 Jun 2024 15:08:39 GMT
|
67
67
|
Source-Age:
|
68
68
|
- '0'
|
69
69
|
body:
|
@@ -11299,7 +11299,7 @@ http_interactions:
|
|
11299
11299
|
HgMUAAAACAA6cm9XZto2RTS1BwAWXlAADQAYAAAAAAABAAAApIEAAAAAaW5k
|
11300
11300
|
ZXgtdjEueWFtbFVUBQADENNUZXV4CwABBOkDAAAEfwAAAFBLBQYAAAAAAQAB
|
11301
11301
|
AFMAAAB7tQcAAAA=
|
11302
|
-
recorded_at:
|
11302
|
+
recorded_at: Thu, 06 Jun 2024 15:03:39 GMT
|
11303
11303
|
- request:
|
11304
11304
|
method: get
|
11305
11305
|
uri: https://raw.githubusercontent.com/relaton/relaton-data-3gpp/main/data/TR_00.01U_UMTS_3.0.0.yaml
|
@@ -11313,6 +11313,8 @@ http_interactions:
|
|
11313
11313
|
- "*/*"
|
11314
11314
|
User-Agent:
|
11315
11315
|
- Ruby
|
11316
|
+
Host:
|
11317
|
+
- raw.githubusercontent.com
|
11316
11318
|
response:
|
11317
11319
|
status:
|
11318
11320
|
code: 200
|
@@ -11339,21 +11341,21 @@ http_interactions:
|
|
11339
11341
|
X-Xss-Protection:
|
11340
11342
|
- 1; mode=block
|
11341
11343
|
X-Github-Request-Id:
|
11342
|
-
-
|
11344
|
+
- 74E0:618D9:438D9D:4BDD0F:6661CFCF
|
11343
11345
|
Accept-Ranges:
|
11344
11346
|
- bytes
|
11345
11347
|
Date:
|
11346
|
-
-
|
11348
|
+
- Thu, 06 Jun 2024 15:03:43 GMT
|
11347
11349
|
Via:
|
11348
11350
|
- 1.1 varnish
|
11349
11351
|
X-Served-By:
|
11350
|
-
- cache-pdk-
|
11352
|
+
- cache-pdk-katl1840058-PDK
|
11351
11353
|
X-Cache:
|
11352
|
-
-
|
11354
|
+
- MISS
|
11353
11355
|
X-Cache-Hits:
|
11354
|
-
- '
|
11356
|
+
- '0'
|
11355
11357
|
X-Timer:
|
11356
|
-
-
|
11358
|
+
- S1717686224.653209,VS0,VE140
|
11357
11359
|
Vary:
|
11358
11360
|
- Authorization,Accept-Encoding,Origin
|
11359
11361
|
Access-Control-Allow-Origin:
|
@@ -11361,9 +11363,9 @@ http_interactions:
|
|
11361
11363
|
Cross-Origin-Resource-Policy:
|
11362
11364
|
- cross-origin
|
11363
11365
|
X-Fastly-Request-Id:
|
11364
|
-
-
|
11366
|
+
- e8aa88a118b77ebf245340bf762a283d74465747
|
11365
11367
|
Expires:
|
11366
|
-
-
|
11368
|
+
- Thu, 06 Jun 2024 15:08:43 GMT
|
11367
11369
|
Source-Age:
|
11368
11370
|
- '0'
|
11369
11371
|
body:
|
@@ -11404,5 +11406,5 @@ http_interactions:
|
|
11404
11406
|
bWVldGluZzogU01HLTI4CiAgZnJlZXplX3N0YWdlMl9tZWV0aW5nOiBTTUct
|
11405
11407
|
MjgKICBmcmVlemVfc3RhZ2UzX21lZXRpbmc6IFNNRy0yOAogIGNsb3NlX21l
|
11406
11408
|
ZXRpbmc6IFNQLTI4CiAgcHJvamVjdF9lbmQ6ICcxOTk5LTAyLTEyJwo=
|
11407
|
-
recorded_at:
|
11409
|
+
recorded_at: Thu, 06 Jun 2024 15:03:43 GMT
|
11408
11410
|
recorded_with: VCR 6.2.0
|
@@ -27,27 +27,27 @@ http_interactions:
|
|
27
27
|
Connection:
|
28
28
|
- keep-alive
|
29
29
|
Date:
|
30
|
-
-
|
30
|
+
- Thu, 06 Jun 2024 15:04:59 GMT
|
31
31
|
X-Amzn-Requestid:
|
32
|
-
-
|
32
|
+
- 1df9b3d6-61e3-436e-b183-9fb15fea30cb
|
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
|
+
- Y81xqGeQIAMEbnw=
|
39
39
|
Access-Control-Allow-Methods:
|
40
40
|
- GET, POST, OPTIONS
|
41
41
|
X-Amzn-Trace-Id:
|
42
|
-
- Root=1-
|
42
|
+
- Root=1-6661d00a-65f629d973f707461427daa4;Parent=2b510a4a08620796;Sampled=0;lineage=521d48d5:0
|
43
43
|
X-Cache:
|
44
44
|
- Miss from cloudfront
|
45
45
|
Via:
|
46
|
-
- 1.1
|
46
|
+
- 1.1 4b4ef7cefd8f81a1e60437d0590406b8.cloudfront.net (CloudFront)
|
47
47
|
X-Amz-Cf-Pop:
|
48
|
-
-
|
48
|
+
- ATL59-P4
|
49
49
|
X-Amz-Cf-Id:
|
50
|
-
-
|
50
|
+
- u-ZD8u9MreGWb0NebHDZUzWoQVJ3j3wo6jtUzeW4mwpdUIZ6I8rrig==
|
51
51
|
body:
|
52
52
|
encoding: UTF-8
|
53
53
|
base64_string: |
|
@@ -117,5 +117,5 @@ http_interactions:
|
|
117
117
|
dHJ1Y3R1cmVkaWRlbnRpZmllciB0eXBlPSJJU08iPgogICAgICA8cHJvamVj
|
118
118
|
dC1udW1iZXI+SVNPIDE5MTE1PC9wcm9qZWN0LW51bWJlcj4KICAgIDwvc3Ry
|
119
119
|
dWN0dXJlZGlkZW50aWZpZXI+CiAgPC9leHQ+CjwvYmliZGF0YT4=
|
120
|
-
recorded_at:
|
120
|
+
recorded_at: Thu, 06 Jun 2024 15:04:59 GMT
|
121
121
|
recorded_with: VCR 6.2.0
|