relaton-nist 1.0.2 → 1.1.0

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: 2f8ebd25c3d58d4680e06a0e3deea8771165830e754b8bdba7efa33e11438ae9
4
- data.tar.gz: 49039dee4164341953e7d3f4b0c886f25a568987e88d63656057dbb4733cb30c
3
+ metadata.gz: 8ec7538ac2ee5dc9e864f3953e6bd28eed9997a24dcd78984cea6eb62ee02033
4
+ data.tar.gz: aa9ba4e4bfb1388f04752c4e17574f6aaa052f8cfcd7cb2faefdb733249c8576
5
5
  SHA512:
6
- metadata.gz: 6e5021613582dfbd5ae9ece8a805d436e86e917f0041d6d6584f6955fd6f7c6b52c6e9e93ba3ed821f6adfc4d7789001eabcbe06863a82ec29b89f681b4ac87f
7
- data.tar.gz: a2ad1bffcbfe3bc948d63d3b0d9ffc2b287a344fa6baf9f62e4fc672dc8b3bdacd4ff3c5ef669cf1325dbf5c4a994a468fbcc187624353d00dc84e2a67fa19ff
6
+ metadata.gz: c47176f1d352f01bbf6c7839acbf84ab9f2f9150bcf0f7c626757f62037c60ec07eb06147c72bf4d2720d5b51fc32a0ad057c0cb4af56efd525136afc240f48d
7
+ data.tar.gz: fb7604fcf82b6ddf4cf5d6ea5710dc809e7de71b2e832575aacbdce70dbc931067f3198c3f7389ba74296b38e438f856872d0afc7e73484d19f5deab20e17e84
@@ -88,7 +88,7 @@
88
88
  <text/>
89
89
  </element>
90
90
  </define>
91
- <define name="LocalizedString">
91
+ <define name="LocalizedString1">
92
92
  <optional>
93
93
  <!-- multiple languages and scripts possible: comma delimit them if so -->
94
94
  <attribute name="language"/>
@@ -98,6 +98,16 @@
98
98
  </optional>
99
99
  <text/>
100
100
  </define>
101
+ <define name="LocalizedString">
102
+ <choice>
103
+ <ref name="LocalizedString1"/>
104
+ <oneOrMore>
105
+ <element name="variant">
106
+ <ref name="LocalizedString1"/>
107
+ </element>
108
+ </oneOrMore>
109
+ </choice>
110
+ </define>
101
111
  <!--
102
112
  Unlike UML, change type to format: type is overloaded
103
113
  Would be need if plain were default value and could omit the attribute
@@ -121,7 +131,7 @@
121
131
  </optional>
122
132
  <ref name="LocalizedStringOrXsAny"/>
123
133
  </define>
124
- <define name="LocalizedStringOrXsAny">
134
+ <define name="LocalizedStringOrXsAny1">
125
135
  <optional>
126
136
  <!-- multiple languages and scripts possible: comma delimit them if so -->
127
137
  <attribute name="language"/>
@@ -136,6 +146,16 @@
136
146
  </choice>
137
147
  </oneOrMore>
138
148
  </define>
149
+ <define name="LocalizedStringOrXsAny">
150
+ <choice>
151
+ <ref name="LocalizedStringOrXsAny1"/>
152
+ <oneOrMore>
153
+ <element name="variant">
154
+ <ref name="LocalizedStringOrXsAny1"/>
155
+ </element>
156
+ </oneOrMore>
157
+ </choice>
158
+ </define>
139
159
  <define name="contributor">
140
160
  <element name="contributor">
141
161
  <zeroOrMore>
@@ -641,9 +661,9 @@
641
661
  <optional>
642
662
  <ref name="status"/>
643
663
  </optional>
644
- <optional>
664
+ <zeroOrMore>
645
665
  <ref name="copyright"/>
646
- </optional>
666
+ </zeroOrMore>
647
667
  <zeroOrMore>
648
668
  <ref name="docrelation"/>
649
669
  </zeroOrMore>
@@ -1001,7 +1021,17 @@
1001
1021
  <optional>
1002
1022
  <ref name="to"/>
1003
1023
  </optional>
1004
- <ref name="owner"/>
1024
+ <oneOrMore>
1025
+ <ref name="owner"/>
1026
+ </oneOrMore>
1027
+ <optional>
1028
+ <ref name="copyright_scope"/>
1029
+ </optional>
1030
+ </element>
1031
+ </define>
1032
+ <define name="copyright_scope">
1033
+ <element name="scope">
1034
+ <text/>
1005
1035
  </element>
1006
1036
  </define>
1007
1037
  <define name="from">
@@ -53,6 +53,14 @@
53
53
  <optional>
54
54
  <attribute name="alt"/>
55
55
  </optional>
56
+ <optional>
57
+ <attribute name="case">
58
+ <choice>
59
+ <value>capital</value>
60
+ <value>lowercase</value>
61
+ </choice>
62
+ </attribute>
63
+ </optional>
56
64
  <text/>
57
65
  </element>
58
66
  </define>
@@ -902,7 +910,15 @@
902
910
  <attribute name="id">
903
911
  <data type="ID"/>
904
912
  </attribute>
905
- <ref name="paragraph"/>
913
+ <oneOrMore>
914
+ <choice>
915
+ <ref name="paragraph"/>
916
+ <ref name="ul"/>
917
+ <ref name="ol"/>
918
+ <ref name="dl"/>
919
+ <ref name="formula"/>
920
+ </choice>
921
+ </oneOrMore>
906
922
  </element>
907
923
  </define>
908
924
  <define name="termexample">
@@ -91,6 +91,12 @@
91
91
  </define>
92
92
  <define name="sections">
93
93
  <element name="sections">
94
+ <zeroOrMore>
95
+ <choice>
96
+ <ref name="note"/>
97
+ <ref name="admonition"/>
98
+ </choice>
99
+ </zeroOrMore>
94
100
  <ref name="clause"/>
95
101
  <optional>
96
102
  <choice>
@@ -263,6 +269,8 @@
263
269
  <value>publicly-available-specification</value>
264
270
  <value>international-workshop-agreement</value>
265
271
  <value>guide</value>
272
+ <value>amendment</value>
273
+ <value>technical-corrigendum</value>
266
274
  </choice>
267
275
  </define>
268
276
  <define name="structuredidentifier">
@@ -510,7 +518,7 @@
510
518
  </attribute>
511
519
  </optional>
512
520
  <oneOrMore>
513
- <ref name="paragraph-with-footnote"/>
521
+ <ref name="BasicBlock"/>
514
522
  </oneOrMore>
515
523
  </element>
516
524
  </define>
@@ -325,7 +325,9 @@ module RelatonNist
325
325
  # @param doc [Nokigiri::HTML::Document]
326
326
  # @return [Array<Hash>]
327
327
  def fetch_abstract(doc)
328
- abstract_content = doc.xpath('//div[contains(@class, "pub-abstract-callout")]/div[1]/p').text
328
+ abstract_content = doc.xpath(
329
+ '//div[contains(@class, "pub-abstract-callout")]/div[1]/p',
330
+ ).text
329
331
  [{
330
332
  content: abstract_content,
331
333
  language: "en",
@@ -336,7 +338,7 @@ module RelatonNist
336
338
 
337
339
  # Fetch copyright.
338
340
  # @param doc [Nokogiri::HTL::Document, String]
339
- # @return [Hash]
341
+ # @return [Array<Hash>]
340
342
  def fetch_copyright(doc)
341
343
  name = "National Institute of Standards and Technology"
342
344
  url = "www.nist.gov"
@@ -345,9 +347,11 @@ module RelatonNist
345
347
  doc.at("//span[@id='pub-release-date']").text.strip
346
348
  end
347
349
  from = d.match(/\d{4}/).to_s
348
- { owner: { name: name, abbreviation: "NIST", url: url }, from: from }
350
+ [{ owner: [{ name: name, abbreviation: "NIST", url: url }], from: from }]
349
351
  end
350
352
 
353
+ # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
354
+
351
355
  # Fetch links.
352
356
  # @param doc [Nokogiri::HTML::Document, Hash]
353
357
  # @return [Array<Hash>]
@@ -365,6 +369,7 @@ module RelatonNist
365
369
  links << { type: "doi", content: doi } if doi
366
370
  links
367
371
  end
372
+ # rubocop:enable Metrics/MethodLength
368
373
 
369
374
  # Fetch relations.
370
375
  # @param doc [Nokogiri::HTML::Document]
@@ -382,6 +387,7 @@ module RelatonNist
382
387
  doc_relation "updates", r.text, DOMAIN + r[:href]
383
388
  end
384
389
  end
390
+ # rubocop:enable Metrics/AbcSize
385
391
 
386
392
  def fetch_relations_json(doc)
387
393
  relations = doc["supersedes"].map do |r|
@@ -409,6 +415,8 @@ module RelatonNist
409
415
  )
410
416
  end
411
417
 
418
+ # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
419
+
412
420
  # @param doc [Nokogiri::HTML::Document]
413
421
  # @return [Array<RelatonBib::Series>]
414
422
  def fetch_series(doc)
@@ -418,14 +426,14 @@ module RelatonNist
418
426
  next if s.name == "span"
419
427
 
420
428
  iter = if idx.zero? then "I"
421
- # elsif status == "final" && idx == (series.size - 1) then "F"
422
429
  else idx + 1
423
430
  end
424
431
 
425
432
  content = s.text.match(/^[^\(]+/).to_s.strip.squeeze " "
426
433
 
427
434
  ref = case s.text
428
- when /^Draft/ then content.match(/(?<=Draft\s).+/).to_s + " (#{iter}PD)"
435
+ when /^Draft/
436
+ content.match(/(?<=Draft\s).+/).to_s + " (#{iter}PD)"
429
437
  when /\(Draft\)/ then content + " (#{iter}PD)"
430
438
  else content
431
439
  end
@@ -436,6 +444,7 @@ module RelatonNist
436
444
  RelatonBib::Series.new(formattedref: fref)
437
445
  end.select { |s| s }
438
446
  end
447
+ # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
439
448
 
440
449
  # @param doc [Nokogiri::HTML::Document, Hash]
441
450
  # @return [Array<RelatonNist::Keyword>]
@@ -448,6 +457,7 @@ module RelatonNist
448
457
  kws.map { |kw| kw.is_a?(String) ? kw : kw.text }
449
458
  end
450
459
 
460
+ # rubocop:disable Metrics/AbcSize
451
461
  # @param doc [Nokogiri::HTML::Document]
452
462
  # @return [RelatonNist::CommentPeriod, NilClass]
453
463
  def fetch_commentperiod(doc)
@@ -459,11 +469,13 @@ module RelatonNist
459
469
  d = doc.at("//span[@id='pub-release-date']").text.strip
460
470
  from = Date.strptime(d, "%B %Y").to_s
461
471
 
462
- ex = doc.at "//strong[contains(.,'The comment closing date has been extended to')]"
472
+ ex = doc.at "//strong[contains(.,'The comment closing date has been "\
473
+ "extended to')]"
463
474
  ext = ex&.text&.match(/\w+\s\d{2},\s\d{4}/).to_s
464
475
  extended = ext.empty? ? nil : Date.strptime(ext, "%B %d, %Y")
465
476
  CommentPeriod.new from: from, to: to, extended: extended
466
477
  end
478
+ # rubocop:enable Metrics/AbcSize
467
479
 
468
480
  # @param json [Hash]
469
481
  # @return [RelatonNist::CommentPeriod, NilClass]
@@ -1,3 +1,3 @@
1
1
  module RelatonNist
2
- VERSION = "1.0.2".freeze
2
+ VERSION = "1.1.0".freeze
3
3
  end
@@ -34,6 +34,6 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency "vcr"
35
35
  spec.add_development_dependency "webmock"
36
36
 
37
- spec.add_dependency "relaton-bib", ">= 1.0.4"
37
+ spec.add_dependency "relaton-bib", "~> 1.1.0"
38
38
  spec.add_dependency "rubyzip"
39
39
  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.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-26 00:00:00.000000000 Z
11
+ date: 2020-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase
@@ -154,16 +154,16 @@ dependencies:
154
154
  name: relaton-bib
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ">="
157
+ - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 1.0.4
159
+ version: 1.1.0
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ">="
164
+ - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 1.0.4
166
+ version: 1.1.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: rubyzip
169
169
  requirement: !ruby/object:Gem::Requirement