relaton-nist 1.8.0 → 1.9.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: 708aed7e58956fbc6f13f3762f643c8dcd894d71d27019e640adf63b8b8b5215
4
- data.tar.gz: 55e8c9f4bfd97442aebb7a4ee782f5620fba41b4f89e33f44cf79f60df6c7f95
3
+ metadata.gz: 51d5205328c024259b5fea0e2632c72eb51045ff119a789e6760a678af3e6961
4
+ data.tar.gz: dc3da903e2308fa2ebc3cf894a4972e69a4bdd0ce8dfe39ca770295856bab0ad
5
5
  SHA512:
6
- metadata.gz: 1a13a4b39a41bce75a8ce7d79f741b38954539701d5f2788b0beee850b4ff54e50055c9ab23a79e0df3b40e6e2dbded6cd4155ea227589d34147b1a0524ce99b
7
- data.tar.gz: 477d2f7d2cd8a3870a469e8e2c5ac12a8c68c3ff96fe0c6fea8bdf903d50c1287d63e0a10b7ca81987db3718330b687f3ebedfed149e6a8ee4e973bd0e03a3cb
6
+ metadata.gz: 7794caf0f138e6028da3b44345bf6206c4770c21d019205aa84bff604bafe88f1eb888c1126ec99bf6f501494c25eed956080f1c5cc72f7cb46427f2c4933ca8
7
+ data.tar.gz: d03f8aec87890fc4bac521318306b87d9c92a174389c9a0109b54cfd360cca387d0c806333a7ffa50a8ae2905c41f2dd8ac14c9903666720ad15615f42e9e757
@@ -16,19 +16,9 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '2.7', '2.6', '2.5', '2.4' ]
19
+ ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
- include:
23
- - ruby: '3.0'
24
- os: 'ubuntu-latest'
25
- experimental: true
26
- - ruby: '3.0'
27
- os: 'windows-latest'
28
- experimental: true
29
- - ruby: '3.0'
30
- os: 'macos-latest'
31
- experimental: true
32
22
  steps:
33
23
  - uses: actions/checkout@v2
34
24
  with:
data/.rubocop.yml CHANGED
@@ -5,6 +5,6 @@
5
5
  inherit_from:
6
6
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
7
7
  AllCops:
8
- TargetRubyVersion: 2.4
8
+ TargetRubyVersion: 2.5
9
9
  Rails:
10
10
  Enabled: false
data/grammars/biblio.rng CHANGED
@@ -787,6 +787,7 @@
787
787
  <value>adapted</value>
788
788
  <value>vote-started</value>
789
789
  <value>vote-ended</value>
790
+ <value>announced</value>
790
791
  </choice>
791
792
  </define>
792
793
  <define name="bdate">
data/grammars/isodoc.rng CHANGED
@@ -45,6 +45,11 @@
45
45
  <optional>
46
46
  <attribute name="alt"/>
47
47
  </optional>
48
+ <optional>
49
+ <attribute name="updatetype">
50
+ <data type="boolean"/>
51
+ </attribute>
52
+ </optional>
48
53
  <text/>
49
54
  </element>
50
55
  </define>
@@ -199,6 +204,18 @@
199
204
  </zeroOrMore>
200
205
  </element>
201
206
  </define>
207
+ <define name="dt">
208
+ <element name="dt">
209
+ <optional>
210
+ <attribute name="id">
211
+ <data type="ID"/>
212
+ </attribute>
213
+ </optional>
214
+ <zeroOrMore>
215
+ <ref name="TextElement"/>
216
+ </zeroOrMore>
217
+ </element>
218
+ </define>
202
219
  <define name="example">
203
220
  <element name="example">
204
221
  <attribute name="id">
@@ -543,6 +560,9 @@
543
560
  </define>
544
561
  <define name="BibDataExtensionType">
545
562
  <ref name="doctype"/>
563
+ <optional>
564
+ <ref name="docsubtype"/>
565
+ </optional>
546
566
  <optional>
547
567
  <ref name="editorialgroup"/>
548
568
  </optional>
@@ -890,6 +910,14 @@
890
910
  </define>
891
911
  </include>
892
912
  <!-- end overrides -->
913
+ <define name="docsubtype">
914
+ <element name="subdoctype">
915
+ <ref name="DocumentSubtype"/>
916
+ </element>
917
+ </define>
918
+ <define name="DocumentSubtype">
919
+ <text/>
920
+ </define>
893
921
  <define name="colgroup">
894
922
  <element name="colgroup">
895
923
  <oneOrMore>
@@ -939,7 +967,34 @@
939
967
  <define name="concept">
940
968
  <element name="concept">
941
969
  <optional>
942
- <attribute name="term"/>
970
+ <attribute name="ital">
971
+ <data type="boolean"/>
972
+ </attribute>
973
+ </optional>
974
+ <optional>
975
+ <attribute name="ref">
976
+ <data type="boolean"/>
977
+ </attribute>
978
+ </optional>
979
+ <optional>
980
+ <element name="refterm">
981
+ <zeroOrMore>
982
+ <choice>
983
+ <ref name="PureTextElement"/>
984
+ <ref name="stem"/>
985
+ </choice>
986
+ </zeroOrMore>
987
+ </element>
988
+ </optional>
989
+ <optional>
990
+ <element name="renderterm">
991
+ <zeroOrMore>
992
+ <choice>
993
+ <ref name="PureTextElement"/>
994
+ <ref name="stem"/>
995
+ </choice>
996
+ </zeroOrMore>
997
+ </element>
943
998
  </optional>
944
999
  <choice>
945
1000
  <ref name="eref"/>
@@ -965,6 +1020,9 @@
965
1020
  </attribute>
966
1021
  <attribute name="name"/>
967
1022
  <attribute name="action"/>
1023
+ <optional>
1024
+ <attribute name="class"/>
1025
+ </optional>
968
1026
  <zeroOrMore>
969
1027
  <choice>
970
1028
  <ref name="TextElement"/>
@@ -1191,13 +1249,17 @@
1191
1249
  </define>
1192
1250
  <define name="IsoWorkgroup">
1193
1251
  <optional>
1194
- <attribute name="number">
1195
- <data type="int"/>
1196
- </attribute>
1252
+ <attribute name="number"/>
1197
1253
  </optional>
1198
1254
  <optional>
1199
1255
  <attribute name="type"/>
1200
1256
  </optional>
1257
+ <optional>
1258
+ <attribute name="identifier"/>
1259
+ </optional>
1260
+ <optional>
1261
+ <attribute name="prefix"/>
1262
+ </optional>
1201
1263
  <text/>
1202
1264
  </define>
1203
1265
  <define name="ics">
@@ -1459,26 +1521,26 @@
1459
1521
  <optional>
1460
1522
  <ref name="section-title"/>
1461
1523
  </optional>
1462
- <group>
1524
+ <choice>
1463
1525
  <choice>
1464
1526
  <group>
1465
- <zeroOrMore>
1527
+ <oneOrMore>
1466
1528
  <ref name="BasicBlock"/>
1467
- </zeroOrMore>
1529
+ </oneOrMore>
1468
1530
  <zeroOrMore>
1469
1531
  <ref name="note"/>
1470
1532
  </zeroOrMore>
1471
1533
  </group>
1472
1534
  <ref name="amend"/>
1473
1535
  </choice>
1474
- <zeroOrMore>
1536
+ <oneOrMore>
1475
1537
  <choice>
1476
1538
  <ref name="clause-subsection"/>
1477
1539
  <ref name="terms"/>
1478
1540
  <ref name="definitions"/>
1479
1541
  </choice>
1480
- </zeroOrMore>
1481
- </group>
1542
+ </oneOrMore>
1543
+ </choice>
1482
1544
  </define>
1483
1545
  <define name="Annex-Section">
1484
1546
  <optional>
data/grammars/nist.rng CHANGED
@@ -65,6 +65,9 @@
65
65
  <optional>
66
66
  <ref name="doctype"/>
67
67
  </optional>
68
+ <optional>
69
+ <ref name="docsubtype"/>
70
+ </optional>
68
71
  <optional>
69
72
  <ref name="editorialgroup"/>
70
73
  </optional>
@@ -18,18 +18,18 @@ module RelatonNist
18
18
  # @param year [String]
19
19
  # @param opts [Hash]
20
20
  # @option opts [String] :stage
21
- def initialize(ref_nbr, year = nil, opts = {}) # rubocop:disable Metrics/AbcSize
21
+ def initialize(ref_nbr, year = nil, opts = {}) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
22
22
  super ref_nbr, year
23
23
 
24
- /(?<docid>(SP|FIPS)\s[0-9-]+)/ =~ text
24
+ /(?<docid>(?:SP|FIPS)\s[0-9-]+)/ =~ text
25
25
  @array = docid ? from_json(docid, **opts) : from_csrc(**opts)
26
26
  @array = from_csrc(**opts) unless @array.any?
27
27
 
28
28
  @array.sort! do |a, b|
29
- if a.sort_value != b.sort_value
30
- b.sort_value - a.sort_value
31
- else
29
+ if a.sort_value == b.sort_value
32
30
  (b.hit[:release_date] - a.hit[:release_date]).to_i
31
+ else
32
+ b.sort_value - a.sort_value
33
33
  end
34
34
  end
35
35
  end
@@ -95,14 +95,13 @@ module RelatonNist
95
95
  # @param stage [String]
96
96
  # @return [Array<Hach>]
97
97
  def select_data(docid, **opts) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength,Metrics/PerceivedComplexity
98
- # ref = docid.sub(/(?<=\d{3}-\d{2})r(\d+)/, ' Rev. \1')
99
98
  d = Date.strptime year, "%Y" if year
100
- # didrx = Regexp.new(docid)
99
+ statuses = %w[draft-public draft-prelim]
101
100
  data.select do |doc|
102
101
  next unless match_year?(doc, d)
103
102
 
104
103
  if /PD/.match? opts[:stage]
105
- next unless %w[draft-public draft-prelim].include? doc["status"]
104
+ next unless statuses.include? doc["status"]
106
105
  else
107
106
  next unless doc["status"] == "final"
108
107
  end
@@ -134,8 +133,8 @@ module RelatonNist
134
133
  #
135
134
  # @prarm ctime [Time, NilClass]
136
135
  def fetch_data(ctime)
137
- resp = OpenURI.open_uri("#{PUBS_EXPORT}.meta")
138
- if !ctime || ctime < resp.last_modified
136
+ # resp = OpenURI.open_uri("#{PUBS_EXPORT}.meta")
137
+ if !ctime || ctime < OpenURI.open_uri("#{PUBS_EXPORT}.meta").last_modified
139
138
  @data = nil
140
139
  uri_open = URI.method(:open) || Kernel.method(:open)
141
140
  FileUtils.mkdir_p DATAFILEDIR unless Dir.exist? DATAFILEDIR
@@ -1,3 +1,3 @@
1
1
  module RelatonNist
2
- VERSION = "1.8.0".freeze
2
+ VERSION = "1.9.0".freeze
3
3
  end
@@ -17,7 +17,7 @@ module RelatonNist
17
17
  # @param item_hash [Hash]
18
18
  # @return [RelatonNist::NistBibliographicItem]
19
19
  def bib_item(item_hash)
20
- NistBibliographicItem.new **item_hash
20
+ NistBibliographicItem.new(**item_hash)
21
21
  end
22
22
 
23
23
  def fetch_status(item)
data/relaton_nist.gemspec CHANGED
@@ -21,19 +21,17 @@ Gem::Specification.new do |spec|
21
21
  spec.bindir = "exe"
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ["lib"]
24
- spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
24
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
25
25
 
26
- # spec.add_development_dependency "debase"
27
26
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
28
27
  spec.add_development_dependency "pry-byebug"
29
28
  spec.add_development_dependency "rake", "~> 10.0"
30
29
  spec.add_development_dependency "rspec", "~> 3.0"
31
- # spec.add_development_dependency "ruby-debug-ide"
32
30
  spec.add_development_dependency "ruby-jing"
33
31
  spec.add_development_dependency "simplecov"
34
32
  spec.add_development_dependency "vcr"
35
33
  spec.add_development_dependency "webmock"
36
34
 
37
- spec.add_dependency "relaton-bib", "~> 1.8.0"
35
+ spec.add_dependency "relaton-bib", "~> 1.9.0"
38
36
  spec.add_dependency "rubyzip"
39
37
  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.8.0
4
+ version: 1.9.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: 2021-05-17 00:00:00.000000000 Z
11
+ date: 2021-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 1.8.0
131
+ version: 1.9.0
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 1.8.0
138
+ version: 1.9.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rubyzip
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -199,7 +199,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
199
199
  requirements:
200
200
  - - ">="
201
201
  - !ruby/object:Gem::Version
202
- version: 2.4.0
202
+ version: 2.5.0
203
203
  required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  requirements:
205
205
  - - ">="