relaton 1.17.1 → 1.17.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton/registry.rb +1 -1
- data/lib/relaton/version.rb +1 -1
- data/relaton.gemspec +1 -0
- data/spec/relaton/processor_spec.rb +63 -23
- data/spec/relaton/registry_spec.rb +4 -0
- data/spec/relaton_spec.rb +9 -0
- data/spec/vcr_cassetes/3gpp_tr_00_01u_umts_3_0_0.yml +14 -14
- data/spec/vcr_cassetes/api_relaton_org.yml +7 -7
- data/spec/vcr_cassetes/api_relaton_org_unavailable.yml +2197 -2199
- data/spec/vcr_cassetes/cc_dir_10005_2019.yml +19 -19
- data/spec/vcr_cassetes/cie_001_1980.yml +29 -49
- data/spec/vcr_cassetes/doi_10_6028_nist_ir_8245.yml +6 -6
- data/spec/vcr_cassetes/ecma_6.yml +130 -130
- data/spec/vcr_cassetes/en_10160_1999.yml +9655 -9658
- data/spec/vcr_cassetes/gb_t_20223_2006.yml +8 -8
- data/spec/vcr_cassetes/ieee_528_2019.yml +2919 -2907
- data/spec/vcr_cassetes/iso_111111119115_1.yml +5 -5
- data/spec/vcr_cassetes/iso_19115_1.yml +2581 -2581
- data/spec/vcr_cassetes/iso_19115_1_2.yml +4781 -4781
- data/spec/vcr_cassetes/iso_19115_1_std.yml +2578 -2578
- data/spec/vcr_cassetes/iso_19115_all_parts.yml +2580 -2581
- data/spec/vcr_cassetes/iso_19133_2005.yml +2554 -2554
- data/spec/vcr_cassetes/iso_combined_applied.yml +4667 -4666
- data/spec/vcr_cassetes/iso_combined_included.yml +4664 -4664
- data/spec/vcr_cassetes/iso_dis.yml +2063 -2068
- data/spec/vcr_cassetes/ogc_19_025r1.yml +213 -211
- data/spec/vcr_cassetes/omg_ami4ccm_1_0.yml +672 -667
- data/spec/vcr_cassetes/rfc_8341.yml +117 -116
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18c8244f75e034cd05320232fae767d59e10bd6de5f2983dad701ed8ddcbef59
|
4
|
+
data.tar.gz: b384e225f15c0fb4600f8bd245e6ee4a5c2820bbaf3fc865a308972e358a3fd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c83e2b59913fead7d8a7fee650ed739330c3f7cbccfc63eec6d9530e7ca433e3bd026f2c7a15a61735b0b2e72d4106fd7ddd6ddc9a4e3cd00be349c2c288a497
|
7
|
+
data.tar.gz: 49ff93fb5f75841a9ae70dae67c437e3b04fa29977dd96cc9a6470ad5dee4183ccf99951a8aa950551b0811a08c3b03f12eb7b3bcbcd7565b039e167fe8e1a23
|
data/lib/relaton/registry.rb
CHANGED
@@ -10,7 +10,7 @@ module Relaton
|
|
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
12
|
relaton_cen relaton_iana relaton_3gpp relaton_oasis relaton_doi relaton_jis
|
13
|
-
relaton_xsf relaton_ccsds relaton_etsi
|
13
|
+
relaton_xsf relaton_ccsds relaton_etsi relaton_isbn
|
14
14
|
].freeze
|
15
15
|
|
16
16
|
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-ieee", "~> 1.17.0"
|
46
46
|
spec.add_dependency "relaton-ietf", "~> 1.17.0"
|
47
47
|
spec.add_dependency "relaton-iho", "~> 1.17.0"
|
48
|
+
spec.add_dependency "relaton-isbn", "~> 1.17.0"
|
48
49
|
spec.add_dependency "relaton-iso", "~> 1.17.0"
|
49
50
|
spec.add_dependency "relaton-itu", "~> 1.17.0"
|
50
51
|
spec.add_dependency "relaton-jis", "~> 1.17.0"
|
@@ -33,41 +33,81 @@ RSpec.describe Relaton::Processor do
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
context "
|
36
|
+
context "flavor processors" do
|
37
37
|
before { Relaton::Registry.instance }
|
38
|
-
let(:processor) { Relaton::Registry.instance.by_type "ETSI" }
|
39
38
|
|
40
|
-
|
41
|
-
|
42
|
-
|
39
|
+
shared_examples "common processor methods" do |flavor, namespace, bibmodule|
|
40
|
+
let(:processor) { Relaton::Registry.instance.by_type flavor }
|
41
|
+
let(:flavor_module) { Object.const_get namespace }
|
42
|
+
let(:bibliography) { Object.const_get "#{namespace}::#{bibmodule}" }
|
43
|
+
|
44
|
+
it "get method should call get method of #{flavor}" do
|
45
|
+
expect(bibliography).to receive(:get).with("code", nil, {}).and_return :item
|
46
|
+
expect(processor.get "code", nil, {}).to eq :item
|
47
|
+
end
|
48
|
+
|
49
|
+
it "grammar_hash method should call grammar_hash method of #{flavor}" do
|
50
|
+
expect(flavor_module).to receive(:grammar_hash).and_return :hash
|
51
|
+
expect(processor.grammar_hash).to eq :hash
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
shared_examples "fetch_data method" do |flavor, fetcher, source|
|
56
|
+
let(:processor) { Relaton::Registry.instance.by_type flavor }
|
57
|
+
let(:fetcher_class) { Object.const_get fetcher }
|
58
|
+
|
59
|
+
it "fetch_data method should call fetch_data method of #{flavor}" do
|
60
|
+
expect(fetcher_class).to receive(:fetch).with(output: "dir", format: "bibxml").and_return :item
|
61
|
+
expect(processor.fetch_data source, output: "dir", format: "bibxml").to eq :item
|
62
|
+
end
|
43
63
|
end
|
44
64
|
|
45
|
-
|
46
|
-
|
47
|
-
|
65
|
+
shared_examples "from_xml method" do |flavor, parser|
|
66
|
+
let(:processor) { Relaton::Registry.instance.by_type flavor }
|
67
|
+
let(:parser_class) { Object.const_get parser }
|
68
|
+
|
69
|
+
it "from_xml method should call from_xml method of #{flavor}" do
|
70
|
+
expect(parser_class).to receive(:from_xml).with("xml").and_return :item
|
71
|
+
expect(processor.from_xml "xml").to eq :item
|
72
|
+
end
|
48
73
|
end
|
49
74
|
|
50
|
-
|
51
|
-
|
52
|
-
|
75
|
+
shared_examples "hash_to_bib method" do |flavor, converter, bibitem|
|
76
|
+
let(:processor) { Relaton::Registry.instance.by_type flavor }
|
77
|
+
let(:converter_class) { Object.const_get converter }
|
78
|
+
let(:bibitem_class) { Object.const_get bibitem }
|
79
|
+
|
80
|
+
it "hash_to_bib method should call hash_to_bib method of #{flavor}" do
|
81
|
+
expect(converter_class).to receive(:hash_to_bib).with(:hash).and_return title: "title"
|
82
|
+
expect(bibitem_class).to receive(:new).with(title: "title").and_return :item
|
83
|
+
expect(processor.hash_to_bib(:hash)).to eq :item
|
84
|
+
end
|
53
85
|
end
|
54
86
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
87
|
+
shared_examples "remove_index_file method" do |flavor, file|
|
88
|
+
let(:processor) { Relaton::Registry.instance.by_type flavor }
|
89
|
+
|
90
|
+
it "remove index file" do
|
91
|
+
index = double "index"
|
92
|
+
expect(index).to receive(:remove_file)
|
93
|
+
expect(Relaton::Index).to receive(:find_or_create)
|
94
|
+
.with(flavor.downcase.to_sym, url: true, file: file).and_return index
|
95
|
+
processor.remove_index_file
|
96
|
+
end
|
59
97
|
end
|
60
98
|
|
61
|
-
|
62
|
-
|
63
|
-
|
99
|
+
context "ETSI processor" do
|
100
|
+
it_behaves_like "common processor methods", "ETSI", "RelatonEtsi", "Bibliography"
|
101
|
+
it_behaves_like "fetch_data method", "ETSI", "RelatonEtsi::DataFetcher", "etsi-csv"
|
102
|
+
it_behaves_like "from_xml method", "ETSI", "RelatonEtsi::XMLParser"
|
103
|
+
it_behaves_like "hash_to_bib method", "ETSI", "RelatonEtsi::HashConverter", "RelatonEtsi::BibliographicItem"
|
104
|
+
it_behaves_like "remove_index_file method", "ETSI", "index-v1.yaml"
|
64
105
|
end
|
65
106
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
processor.remove_index_file
|
107
|
+
context "ISBN processor" do
|
108
|
+
it_behaves_like "common processor methods", "ISBN", "RelatonIsbn", "OpenLibrary"
|
109
|
+
it_behaves_like "from_xml method", "ISBN", "RelatonBib::XMLParser"
|
110
|
+
it_behaves_like "hash_to_bib method", "ISBN", "RelatonBib::HashConverter", "RelatonBib::BibliographicItem"
|
71
111
|
end
|
72
112
|
end
|
73
113
|
end
|
@@ -123,6 +123,10 @@ RSpec.describe Relaton::Registry do
|
|
123
123
|
it "ETSI" do
|
124
124
|
expect(Relaton::Registry.instance.by_type("ETSI")).to be_instance_of RelatonEtsi::Processor
|
125
125
|
end
|
126
|
+
|
127
|
+
it "ISBN" do
|
128
|
+
expect(Relaton::Registry.instance.by_type("ISBN")).to be_instance_of RelatonIsbn::Processor
|
129
|
+
end
|
126
130
|
end
|
127
131
|
|
128
132
|
it "find processot by dataset" do
|
data/spec/relaton_spec.rb
CHANGED
@@ -364,6 +364,15 @@ RSpec.describe Relaton::Db do
|
|
364
364
|
expect(bib.docidentifier.first.id).to eq "ETSI EN 300 175-8"
|
365
365
|
end
|
366
366
|
|
367
|
+
it "get ISBN reference" do
|
368
|
+
docid = RelatonBib::DocumentIdentifier.new(id: "ISBN 978-0-580-50101-4", type: "ISBN")
|
369
|
+
item = RelatonBib::BibliographicItem.new docid: [docid]
|
370
|
+
expect(RelatonIsbn::OpenLibrary).to receive(:get).with("ISBN 978-0-580-50101-4", nil, {}).and_return item
|
371
|
+
bib = @db.fetch "ISBN 978-0-580-50101-4"
|
372
|
+
expect(bib).to be_instance_of RelatonBib::BibliographicItem
|
373
|
+
expect(bib.docidentifier.first.id).to eq "ISBN 978-0-580-50101-4"
|
374
|
+
end
|
375
|
+
|
367
376
|
context "get combined documents" do
|
368
377
|
context "ISO" do
|
369
378
|
it "included" 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
|
+
- EA0A:234C:6136C2:76A26F:657CBECC
|
43
43
|
Accept-Ranges:
|
44
44
|
- bytes
|
45
45
|
Date:
|
46
|
-
-
|
46
|
+
- Fri, 15 Dec 2023 21:02:05 GMT
|
47
47
|
Via:
|
48
48
|
- 1.1 varnish
|
49
49
|
X-Served-By:
|
50
|
-
- cache-pdk-
|
50
|
+
- cache-pdk-kpdk1780087-PDK
|
51
51
|
X-Cache:
|
52
52
|
- MISS
|
53
53
|
X-Cache-Hits:
|
54
54
|
- '0'
|
55
55
|
X-Timer:
|
56
|
-
-
|
56
|
+
- S1702674125.021523,VS0,VE264
|
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
|
+
- 7cf65cbbcbdaeb1dfc42be6245dcb99d105b95c2
|
65
65
|
Expires:
|
66
|
-
-
|
66
|
+
- Fri, 15 Dec 2023 21:07:05 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: Fri, 15 Dec 2023 21:02:05 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
|
@@ -11341,21 +11341,21 @@ http_interactions:
|
|
11341
11341
|
X-Xss-Protection:
|
11342
11342
|
- 1; mode=block
|
11343
11343
|
X-Github-Request-Id:
|
11344
|
-
-
|
11344
|
+
- B8D8:0424:5FE216:754B4B:657CBED0
|
11345
11345
|
Accept-Ranges:
|
11346
11346
|
- bytes
|
11347
11347
|
Date:
|
11348
|
-
-
|
11348
|
+
- Fri, 15 Dec 2023 21:02:08 GMT
|
11349
11349
|
Via:
|
11350
11350
|
- 1.1 varnish
|
11351
11351
|
X-Served-By:
|
11352
|
-
- cache-pdk-
|
11352
|
+
- cache-pdk-kpdk1780090-PDK
|
11353
11353
|
X-Cache:
|
11354
11354
|
- MISS
|
11355
11355
|
X-Cache-Hits:
|
11356
11356
|
- '0'
|
11357
11357
|
X-Timer:
|
11358
|
-
-
|
11358
|
+
- S1702674129.629585,VS0,VE137
|
11359
11359
|
Vary:
|
11360
11360
|
- Authorization,Accept-Encoding,Origin
|
11361
11361
|
Access-Control-Allow-Origin:
|
@@ -11363,9 +11363,9 @@ http_interactions:
|
|
11363
11363
|
Cross-Origin-Resource-Policy:
|
11364
11364
|
- cross-origin
|
11365
11365
|
X-Fastly-Request-Id:
|
11366
|
-
-
|
11366
|
+
- e5a350b43167b7f3d41e7f2809b0d4869346f491
|
11367
11367
|
Expires:
|
11368
|
-
-
|
11368
|
+
- Fri, 15 Dec 2023 21:07:08 GMT
|
11369
11369
|
Source-Age:
|
11370
11370
|
- '0'
|
11371
11371
|
body:
|
@@ -11406,5 +11406,5 @@ http_interactions:
|
|
11406
11406
|
bWVldGluZzogU01HLTI4CiAgZnJlZXplX3N0YWdlMl9tZWV0aW5nOiBTTUct
|
11407
11407
|
MjgKICBmcmVlemVfc3RhZ2UzX21lZXRpbmc6IFNNRy0yOAogIGNsb3NlX21l
|
11408
11408
|
ZXRpbmc6IFNQLTI4CiAgcHJvamVjdF9lbmQ6ICcxOTk5LTAyLTEyJwo=
|
11409
|
-
recorded_at:
|
11409
|
+
recorded_at: Fri, 15 Dec 2023 21:02:08 GMT
|
11410
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
|
+
- Fri, 15 Dec 2023 21:02:54 GMT
|
31
31
|
X-Amzn-Requestid:
|
32
|
-
-
|
32
|
+
- d5797694-3f7c-4b5c-b0b4-4e258aa6421b
|
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
|
+
- QALFSHcAoAMEfnQ=
|
39
39
|
Access-Control-Allow-Methods:
|
40
40
|
- GET, POST, OPTIONS
|
41
41
|
X-Amzn-Trace-Id:
|
42
|
-
- Root=1-
|
42
|
+
- Root=1-657cbeee-0e87a651219ca2fd35614c22;Sampled=0;lineage=521d48d5:0
|
43
43
|
X-Cache:
|
44
44
|
- Miss from cloudfront
|
45
45
|
Via:
|
46
|
-
- 1.1
|
46
|
+
- 1.1 fc1009b8e45427207e2a571827e9dd24.cloudfront.net (CloudFront)
|
47
47
|
X-Amz-Cf-Pop:
|
48
48
|
- ATL51-C1
|
49
49
|
X-Amz-Cf-Id:
|
50
|
-
-
|
50
|
+
- _diMw4SxewdLl3Da5yx4iI-ZOXbCTRmzU6L0JQUGRIumlHu4ejmYCg==
|
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: Fri, 15 Dec 2023 21:02:54 GMT
|
121
121
|
recorded_with: VCR 6.2.0
|