relaton 1.20.1 → 1.20.3

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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +1 -0
  3. data/.github/workflows/rubocop.yml +48 -0
  4. data/.gitignore +2 -0
  5. data/.rubocop.yml +2 -2
  6. data/CLAUDE.md +68 -0
  7. data/Gemfile +5 -5
  8. data/docs/README.adoc +20 -0
  9. data/lib/relaton/db.rb +64 -0
  10. data/lib/relaton/version.rb +1 -1
  11. data/relaton.gemspec +5 -5
  12. data/spec/relaton/db_spec.rb +193 -0
  13. data/spec/relaton_spec.rb +26 -6
  14. data/spec/vcr_cassetes/3gpp_tr_00_01u_umts_3_0_0.yml +2044 -1367
  15. data/spec/vcr_cassetes/api_relaton_org.yml +9 -9
  16. data/spec/vcr_cassetes/api_relaton_org_unavailable.yml +22 -22
  17. data/spec/vcr_cassetes/cc_dir_10005_2019.yml +19 -17
  18. data/spec/vcr_cassetes/cie_001_1980.yml +44 -44
  19. data/spec/vcr_cassetes/cipm_meeting_43.yml +1356 -1361
  20. data/spec/vcr_cassetes/doi_10_6028_nist_ir_8245.yml +56 -63
  21. data/spec/vcr_cassetes/ecma_6.yml +63 -121
  22. data/spec/vcr_cassetes/en_10160_1999.yml +13294 -12510
  23. data/spec/vcr_cassetes/gb_t_20223_2006.yml +600 -460
  24. data/spec/vcr_cassetes/ieee_528_2019.yml +2414 -2249
  25. data/spec/vcr_cassetes/iso_19115_1.yml +1458 -1251
  26. data/spec/vcr_cassetes/iso_19115_1_2.yml +40 -40
  27. data/spec/vcr_cassetes/iso_19115_1_std.yml +1456 -1249
  28. data/spec/vcr_cassetes/iso_19115_all_parts.yml +22 -22
  29. data/spec/vcr_cassetes/iso_19133_2005.yml +20 -20
  30. data/spec/vcr_cassetes/iso_combined_applied.yml +41 -41
  31. data/spec/vcr_cassetes/iso_combined_included.yml +40 -40
  32. data/spec/vcr_cassetes/iso_dis.yml +20 -20
  33. data/spec/vcr_cassetes/ogc_19_025r1.yml +238 -230
  34. data/spec/vcr_cassetes/omg_ami4ccm_1_0.yml +278 -1514
  35. data/spec/vcr_cassetes/rfc_8341.yml +56 -34
  36. metadata +13 -12
  37. data/.hound.yml +0 -3
data/spec/relaton_spec.rb CHANGED
@@ -1,8 +1,16 @@
1
1
  RSpec.describe Relaton::Db do
2
- before :each do
2
+ before :each do |example|
3
3
  FileUtils.rm_rf %w(testcache testcache2)
4
4
  @db = Relaton::Db.new "testcache", "testcache2"
5
5
  Relaton.instance_variable_set :@configuration, nil
6
+
7
+ if example.metadata[:vcr]
8
+ require "relaton/index"
9
+ allow_any_instance_of(Relaton::Index::Type)
10
+ .to receive(:actual?).and_return(false)
11
+ allow_any_instance_of(Relaton::Index::FileIO)
12
+ .to receive(:check_file).and_return(nil)
13
+ end
6
14
  end
7
15
 
8
16
  it "rejects an illegal reference prefix" do
@@ -62,6 +70,7 @@ RSpec.describe Relaton::Db do
62
70
 
63
71
  context "IEC" do
64
72
  before do
73
+ require "relaton_iec"
65
74
  docid = RelatonBib::DocumentIdentifier.new(id: "IEC 60050-102:2007", type: "IEC")
66
75
  item = RelatonIec::IecBibliographicItem.new docid: [docid]
67
76
  expect(RelatonIec::IecBibliography).to receive(:get).with("IEC 60050-102:2007", nil, {}).and_return item
@@ -238,6 +247,7 @@ RSpec.describe Relaton::Db do
238
247
  # end
239
248
 
240
249
  it "get W3C reference" do
250
+ require "relaton_w3c"
241
251
  docid = RelatonBib::DocumentIdentifier.new(id: "W3C REC-json-ld11-20200716", type: "W3C")
242
252
  item = RelatonW3c::W3cBibliographicItem.new docid: [docid]
243
253
  expect(RelatonW3c::W3cBibliography).to receive(:get).with("W3C REC-json-ld11-20200716", nil, {}).and_return item
@@ -247,6 +257,7 @@ RSpec.describe Relaton::Db do
247
257
  end
248
258
 
249
259
  it "get CCSDS reference" do
260
+ require "relaton_ccsds"
250
261
  docid = RelatonBib::DocumentIdentifier.new id: "CCSDS 230.2-G-1", type: "CCSDS"
251
262
  item = RelatonCcsds::BibliographicItem.new docid: [docid]
252
263
  expect(RelatonCcsds::Bibliography).to receive(:get).with("CCSDS 230.2-G-1", nil, {}).and_return item
@@ -255,14 +266,13 @@ RSpec.describe Relaton::Db do
255
266
  expect(bib.docidentifier.first.id).to eq "CCSDS 230.2-G-1"
256
267
  end
257
268
 
258
- it "get IEEE reference" do
259
- VCR.use_cassette "ieee_528_2019" do
260
- bib = @db.fetch "IEEE 528-2019"
261
- expect(bib).to be_instance_of RelatonIeee::IeeeBibliographicItem
262
- end
269
+ it "get IEEE reference", vcr: "ieee_528_2019" do
270
+ bib = @db.fetch "IEEE Std 528-2019"
271
+ expect(bib).to be_instance_of RelatonIeee::IeeeBibliographicItem
263
272
  end
264
273
 
265
274
  it "get IHO reference" do
275
+ require "relaton_iho"
266
276
  docid = RelatonBib::DocumentIdentifier.new(id: "IHO B-11", type: "IHO")
267
277
  item = RelatonIho::IhoBibliographicItem.new docid: [docid]
268
278
  expect(RelatonIho::IhoBibliography).to receive(:get).with("IHO B-11", nil, {}).and_return item
@@ -286,6 +296,7 @@ RSpec.describe Relaton::Db do
286
296
  end
287
297
 
288
298
  it "get BSI reference" do
299
+ require "relaton_bsi"
289
300
  docid = RelatonBib::DocumentIdentifier.new(id: "BSI BS EN ISO 8848", type: "BSI")
290
301
  item = RelatonBsi::BsiBibliographicItem.new docid: [docid]
291
302
  expect(RelatonBsi::BsiBibliography).to receive(:get).with("BSI BS EN ISO 8848", nil, {}).and_return item
@@ -301,6 +312,7 @@ RSpec.describe Relaton::Db do
301
312
  end
302
313
 
303
314
  it "get IANA reference" do
315
+ require "relaton_iana"
304
316
  docid = RelatonBib::DocumentIdentifier.new(id: "IANA service-names-port-numbers", type: "IANA")
305
317
  item = RelatonIana::IanaBibliographicItem.new docid: [docid]
306
318
  expect(RelatonIana::IanaBibliography).to receive(:get).with("IANA service-names-port-numbers", nil, {}).and_return item
@@ -316,6 +328,7 @@ RSpec.describe Relaton::Db do
316
328
  end
317
329
 
318
330
  it "get OASIS reference" do
331
+ require "relaton_oasis"
319
332
  docid = RelatonBib::DocumentIdentifier.new(id: "OASIS amqp-core-types-v1.0-Pt1", type: "OASIS")
320
333
  item = RelatonOasis::OasisBibliographicItem.new docid: [docid]
321
334
  expect(RelatonOasis::OasisBibliography).to receive(:get).with("OASIS amqp-core-types-v1.0-Pt1", nil, {}).and_return item
@@ -324,6 +337,7 @@ RSpec.describe Relaton::Db do
324
337
  end
325
338
 
326
339
  it "get BIPM reference" do
340
+ require "relaton_bipm"
327
341
  docid = RelatonBib::DocumentIdentifier.new(id: "BIPM Metrologia 29 6 373", type: "BIPM")
328
342
  item = RelatonBipm::BipmBibliographicItem.new docid: [docid]
329
343
  expect(RelatonBipm::BipmBibliography).to receive(:get).with("BIPM Metrologia 29 6 373", nil, {}).and_return item
@@ -338,6 +352,7 @@ RSpec.describe Relaton::Db do
338
352
  end
339
353
 
340
354
  it "get JIS reference" do
355
+ require "relaton_jis"
341
356
  docid = RelatonBib::DocumentIdentifier.new(id: "JIS X 0001", type: "JIS")
342
357
  item = RelatonJis::BibliographicItem.new docid: [docid]
343
358
  expect(RelatonJis::Bibliography).to receive(:get).with("JIS X 0001", nil, {}).and_return item
@@ -347,6 +362,7 @@ RSpec.describe Relaton::Db do
347
362
  end
348
363
 
349
364
  it "get XSF reference" do
365
+ require "relaton_xsf"
350
366
  docid = RelatonBib::DocumentIdentifier.new(id: "XEP 0001", type: "XSF")
351
367
  item = RelatonXsf::BibliographicItem.new docid: [docid]
352
368
  expect(RelatonXsf::Bibliography).to receive(:get).with("XEP 0001", nil, {}).and_return item
@@ -356,6 +372,7 @@ RSpec.describe Relaton::Db do
356
372
  end
357
373
 
358
374
  it "get ETSI reference" do
375
+ require "relaton_etsi"
359
376
  docid = RelatonBib::DocumentIdentifier.new(id: "ETSI EN 300 175-8", type: "ETSI")
360
377
  item = RelatonEtsi::BibliographicItem.new docid: [docid]
361
378
  expect(RelatonEtsi::Bibliography).to receive(:get).with("ETSI EN 300 175-8", nil, {}).and_return item
@@ -365,6 +382,7 @@ RSpec.describe Relaton::Db do
365
382
  end
366
383
 
367
384
  it "get ISBN reference" do
385
+ require "relaton_isbn"
368
386
  docid = RelatonBib::DocumentIdentifier.new(id: "ISBN 978-0-580-50101-4", type: "ISBN")
369
387
  item = RelatonBib::BibliographicItem.new docid: [docid]
370
388
  expect(RelatonIsbn::OpenLibrary).to receive(:get).with("ISBN 978-0-580-50101-4", nil, {}).and_return item
@@ -374,6 +392,7 @@ RSpec.describe Relaton::Db do
374
392
  end
375
393
 
376
394
  it "get PLATEAU reference" do
395
+ require "relaton/plateau"
377
396
  docid = RelatonBib::DocumentIdentifier.new(id: "PLATEAU Hanbook #01", type: "PLATEAU")
378
397
  item = Relaton::Plateau::BibItem.new docid: [docid]
379
398
  expect(Relaton::Plateau::Bibliography).to receive(:get).with("PLATEAU Hanbook #01", nil, {}).and_return item
@@ -432,6 +451,7 @@ RSpec.describe Relaton::Db do
432
451
 
433
452
  context "ITU" do
434
453
  it "included" do
454
+ require "relaton_itu"
435
455
  docid = RelatonBib::DocumentIdentifier.new(id: "ITU-T G.989.2", type: "ITU")
436
456
  group = RelatonItu::ItuGroup.new(name: "Group")
437
457
  ed = RelatonItu::EditorialGroup.new(bureau: "Bureau", group: group)