relaton-nist 1.9.7 → 1.9.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67f9b42b4407dc8a63c3e83f75e863d260302fb3bcb61d4983cc12dff591a01b
4
- data.tar.gz: 910b5878d79dc0f4406954e2460d39ec4ded01fe75ceb8835430f140941d6dba
3
+ metadata.gz: b8d329e1c313005dc313d6a9f11581a3091c11357eaffaed991e70936d676884
4
+ data.tar.gz: ee7c8965f6ccec33db3be2a88c577fc85de894b0797c16d4b48eeb0533466fd8
5
5
  SHA512:
6
- metadata.gz: 7ccc8b6077c52845934359b45a33a8f4991b8dec44b68ca1704fbfd35f1a72a0e42ed319d967727963d1c99d2874e4991d581291dc6e66d8557a57f3e2093b04
7
- data.tar.gz: 2f10467a456fb8eaa30def322fa8dfcda3968b5adc18c176cccabec22a71d391c183429773d983d25f4214507684a8b674d1cf862f429d51116ed324193a1fc0
6
+ metadata.gz: f43154e131aafeb2ccebeff6444d3a5ea2a1194e010c05b72388deb118d3db92b42a51e20e71ce53872bdae88fa504f49e1b16917d6d5502f74a99c11d742af7
7
+ data.tar.gz: 9e4146500cb2724b7c42208cbb6432d1cb7b8d8b83156572e0dd3159d202504d707662995657cffb49ff6440a31d0de3398bd3ee35b744d6aaf636bdbc422154
data/grammars/biblio.rng CHANGED
@@ -401,9 +401,9 @@
401
401
  <choice>
402
402
  <!-- iso191606 TODO -->
403
403
  <group>
404
- <oneOrMore>
404
+ <zeroOrMore>
405
405
  <ref name="street"/>
406
- </oneOrMore>
406
+ </zeroOrMore>
407
407
  <ref name="city"/>
408
408
  <optional>
409
409
  <ref name="state"/>
@@ -42,8 +42,17 @@ module RelatonNist
42
42
  anchor(doc).gsub(".", " ")
43
43
  end
44
44
 
45
- def doi(doc)
46
- doc.at("doi_data/doi").text
45
+ def doi(doc) # rubocop:disable Metrics/CyclomaticComplexity
46
+ id = doc.at("doi_data/doi").text
47
+ case id
48
+ when "10.6028/NBS.CIRC.e2e" then "10.6028/NBS.CIRC.2e2"
49
+ when "10.6028/NBS.CIRC.sup" then "10.6028/NBS.CIRC.24e7sup"
50
+ when "10.6028/NBS.CIRC.supJun1925-Jun1926" then "10.6028/NBS.CIRC.24e7sup2"
51
+ when "10.6028/NBS.CIRC.supJun1925-Jun1927" then "10.6028/NBS.CIRC.24e7sup3"
52
+ when "10.6028/NBS.CIRC.24supJuly1922" then "10.6028/NBS.CIRC.24e6sup"
53
+ when "10.6028/NBS.CIRC.24supJan1924" then "10.6028/NBS.CIRC.24e6sup2"
54
+ else id
55
+ end
47
56
  end
48
57
 
49
58
  def anchor(doc)
@@ -209,9 +209,15 @@ module RelatonNist
209
209
  # @param ref [String]
210
210
  # @param uri [String]
211
211
  # @return [RelatonNist::DocumentRelation]
212
- def doc_relation(type, ref, uri, lang = "en", script = "Latn")
212
+ def doc_relation(type, ref, uri, lang = "en", script = "Latn") # rubocop:disable Metrics/MethodLength
213
+ if type == "supersedes"
214
+ descr = RelatonBib::FormattedString.new(content: "supersedes", language: lang, script: script)
215
+ t = "obsoletes"
216
+ else t = type
217
+ end
213
218
  DocumentRelation.new(
214
- type: type,
219
+ type: t,
220
+ description: descr,
215
221
  bibitem: RelatonBib::BibliographicItem.new(
216
222
  formattedref: RelatonBib::FormattedRef.new(
217
223
  content: ref, language: lang, script: script, format: "text/plain",
@@ -1,3 +1,3 @@
1
1
  module RelatonNist
2
- VERSION = "1.9.7".freeze
2
+ VERSION = "1.9.8".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-nist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.7
4
+ version: 1.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-17 00:00:00.000000000 Z
11
+ date: 2022-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml