relaton 1.18.0 → 1.18.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/lib/relaton/db.rb +13 -2
- data/lib/relaton/version.rb +1 -1
- data/spec/relaton/db_spec.rb +32 -0
- data/spec/vcr_cassetes/3gpp_tr_00_01u_umts_3_0_0.yml +20 -18
- data/spec/vcr_cassetes/api_relaton_org.yml +7 -7
- data/spec/vcr_cassetes/api_relaton_org_unavailable.yml +3266 -3221
- data/spec/vcr_cassetes/cc_dir_10005_2019.yml +25 -25
- data/spec/vcr_cassetes/cie_001_1980.yml +219 -195
- data/spec/vcr_cassetes/doi_10_6028_nist_ir_8245.yml +6 -6
- data/spec/vcr_cassetes/ecma_6.yml +36 -35
- data/spec/vcr_cassetes/en_10160_1999.yml +10953 -10926
- data/spec/vcr_cassetes/gb_t_20223_2006.yml +8 -8
- data/spec/vcr_cassetes/ieee_528_2019.yml +2094 -2928
- data/spec/vcr_cassetes/iso_111111119115_1.yml +11 -8
- data/spec/vcr_cassetes/iso_19115_1.yml +3421 -3385
- data/spec/vcr_cassetes/iso_19115_1_2.yml +6687 -6606
- data/spec/vcr_cassetes/iso_19115_1_std.yml +3419 -3382
- data/spec/vcr_cassetes/iso_19115_all_parts.yml +3423 -3385
- data/spec/vcr_cassetes/iso_19133_2005.yml +3448 -3412
- data/spec/vcr_cassetes/iso_combined_applied.yml +5942 -5867
- data/spec/vcr_cassetes/iso_combined_included.yml +5945 -5870
- data/spec/vcr_cassetes/iso_dis.yml +3134 -3100
- data/spec/vcr_cassetes/ogc_19_025r1.yml +193 -193
- data/spec/vcr_cassetes/omg_ami4ccm_1_0.yml +889 -884
- data/spec/vcr_cassetes/rfc_8341.yml +39 -36
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: af8b5d7f3d6847ea4b48d9bb60dbc19c2cfb954c87e393b1dc029cb91e694c3b
|
|
4
|
+
data.tar.gz: 380db51f0e9dbad1f0b71f14a5ec6dca444a73f68999e7e4814cb1a1f43d3c24
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a30902c431c0b597f6556428769715e67d1edd091316f22f9e8040884139404a69a33bccd3f8b0ce4fa743f99cc509c112eaeacafe40f7cf52c581a9d0ed53d0
|
|
7
|
+
data.tar.gz: 5e7f96ac654ea64dff9604c2e2a09a5460c985dd447e368cbbf2d58ff41dd3d4537d0f7925ad753999c9f5e325f702059f588b54f556474a5a94b8f05315a579
|
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/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
|
|
@@ -39,21 +39,21 @@ http_interactions:
|
|
|
39
39
|
X-Xss-Protection:
|
|
40
40
|
- 1; mode=block
|
|
41
41
|
X-Github-Request-Id:
|
|
42
|
-
-
|
|
42
|
+
- AF8E:3D9C:52425E:6105F0:65C45A0E
|
|
43
43
|
Accept-Ranges:
|
|
44
44
|
- bytes
|
|
45
45
|
Date:
|
|
46
|
-
-
|
|
46
|
+
- Thu, 08 Feb 2024 04:35:26 GMT
|
|
47
47
|
Via:
|
|
48
48
|
- 1.1 varnish
|
|
49
49
|
X-Served-By:
|
|
50
|
-
- cache-pdk-
|
|
50
|
+
- cache-pdk-kpdk1780041-PDK
|
|
51
51
|
X-Cache:
|
|
52
|
-
-
|
|
52
|
+
- MISS
|
|
53
53
|
X-Cache-Hits:
|
|
54
|
-
- '
|
|
54
|
+
- '0'
|
|
55
55
|
X-Timer:
|
|
56
|
-
-
|
|
56
|
+
- S1707366926.197574,VS0,VE231
|
|
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
|
+
- 0d065624f1a175178ec59d149cb969b493434950
|
|
65
65
|
Expires:
|
|
66
|
-
-
|
|
66
|
+
- Thu, 08 Feb 2024 04:40:26 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, 08 Feb 2024 04:35:26 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
|
+
- BD5E:49CA:418C58:4D25B2:65C45A11
|
|
11343
11345
|
Accept-Ranges:
|
|
11344
11346
|
- bytes
|
|
11345
11347
|
Date:
|
|
11346
|
-
-
|
|
11348
|
+
- Thu, 08 Feb 2024 04:35:30 GMT
|
|
11347
11349
|
Via:
|
|
11348
11350
|
- 1.1 varnish
|
|
11349
11351
|
X-Served-By:
|
|
11350
|
-
- cache-pdk-
|
|
11352
|
+
- cache-pdk-kpdk1780132-PDK
|
|
11351
11353
|
X-Cache:
|
|
11352
|
-
-
|
|
11354
|
+
- MISS
|
|
11353
11355
|
X-Cache-Hits:
|
|
11354
|
-
- '
|
|
11356
|
+
- '0'
|
|
11355
11357
|
X-Timer:
|
|
11356
|
-
-
|
|
11358
|
+
- S1707366930.087565,VS0,VE159
|
|
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
|
+
- bc9142ca8bb17cb878fb0d6088b57b5668e292ac
|
|
11365
11367
|
Expires:
|
|
11366
|
-
-
|
|
11368
|
+
- Thu, 08 Feb 2024 04:40:30 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, 08 Feb 2024 04:35:30 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, 08 Feb 2024 04:36:19 GMT
|
|
31
31
|
X-Amzn-Requestid:
|
|
32
|
-
-
|
|
32
|
+
- 12c03e4b-24de-4537-95ca-f4db5de98d7b
|
|
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
|
+
- SzMH7Eb0oAMEgTQ=
|
|
39
39
|
Access-Control-Allow-Methods:
|
|
40
40
|
- GET, POST, OPTIONS
|
|
41
41
|
X-Amzn-Trace-Id:
|
|
42
|
-
- Root=1-
|
|
42
|
+
- Root=1-65c45a32-613956cb2302343f56f4374f;Parent=29415cb8fd97d15e;Sampled=0;lineage=521d48d5:0
|
|
43
43
|
X-Cache:
|
|
44
44
|
- Miss from cloudfront
|
|
45
45
|
Via:
|
|
46
|
-
- 1.1
|
|
46
|
+
- 1.1 2049bafbdd2d1f88e039f5995c93088a.cloudfront.net (CloudFront)
|
|
47
47
|
X-Amz-Cf-Pop:
|
|
48
48
|
- ATL51-C1
|
|
49
49
|
X-Amz-Cf-Id:
|
|
50
|
-
-
|
|
50
|
+
- 9fUBqPyNt3zSyV83upqlH_JqjvIYzM8pq6Zw0gngiy4n71szIx-jmA==
|
|
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, 08 Feb 2024 04:36:19 GMT
|
|
121
121
|
recorded_with: VCR 6.2.0
|