relaton-nist 1.14.4 → 1.14.5

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: b6d5fa6a33aea5f2dd4cf62aa71a4da7ab9b41847ac35f35053810cccf2d334a
4
- data.tar.gz: f38d1704600169333dfbcc8e24f29bbdc93f92f47ded7754f04a4492bd3dd1a1
3
+ metadata.gz: 2b442dc75e9c4b20221b94bd56200f5391f479709cb44bda543827bdeca67cf7
4
+ data.tar.gz: 553d1a834486c36d3febec1046480f5e803d98865c34f119c5698b253f3186fd
5
5
  SHA512:
6
- metadata.gz: c807912db5bef3e57fc3a70ae862a6f9adca7b884d9174f56457ac28443a6bef6c572b745f5c3df6377313e5140b1a625c546ee9a93eaf050d70ccad4ad351b2
7
- data.tar.gz: 64a6c9e1f751d6b8bfeae3c22b6fe7197e1d516afda4205dbcaf4cd67381ee6fc95e57865882a916824b6751feec7791138fbffa2d61357fd45e4797c436c35a
6
+ metadata.gz: d1b1c058632239fefd0bb171f645eba0a7036e806fc3064faa4f2742d386e01e07f891b4c89172ae6b9811e75d6d05b0603391e68b58ae88789cb2d9cbd8ed35
7
+ data.tar.gz: '07039ccd91afca1ebc62471d0c7b3fa64695f7f5ed88f0eb11fd12d00c87851a33f66c08d7ba4e69f61ff0b1a82bb9e0a88eaf613d18d00b4a4e52ac051916f4'
@@ -58,14 +58,11 @@ module RelatonNist
58
58
  parts = doi_parts(item.hit[:json]) || code_parts(item.hit[:code])
59
59
  (refparts[:code] && [parts[:series], item.hit[:series]].include?(refparts[:series]) &&
60
60
  refparts[:code].casecmp(parts[:code].upcase).zero? &&
61
- (!refparts[:prt] || refparts[:prt] == parts[:prt]) &&
62
- (!refparts[:vol] || refparts[:vol] == parts[:vol]) &&
63
- (!refparts[:ver] || refparts[:ver] == parts[:ver]) &&
64
- (!refparts[:rev] || refparts[:rev] == parts[:rev]) &&
65
- refparts[:draft] == parts[:draft] && refparts[:add] == parts[:add] &&
66
- refparts[:res] == parts[:res]) # ||
67
- # (refparts[:code] && !refparts[:code].empty? &&
68
- # item.hit[:title]&.include?("#{refparts[:series]} #{refparts[:code]}"))
61
+ (refparts[:prt] == parts[:prt]) &&
62
+ (refparts[:vol] == parts[:vol]) &&
63
+ (refparts[:ver] == parts[:ver]) &&
64
+ (refparts[:rev] == parts[:rev]) &&
65
+ refparts[:draft] == parts[:draft] && refparts[:add] == parts[:add])
69
66
  end
70
67
  end
71
68
 
@@ -73,7 +70,7 @@ module RelatonNist
73
70
 
74
71
  def code_parts(code) # rubocop:disable Metrics/MethodLength
75
72
  {
76
- prefix: match(/^(?:NIST|NBS)\s?/, code),
73
+ # prefix: match(/^(?:NIST|NBS)\s?/, code),
77
74
  series: match(/(?<val>(?:SP|FIPS|IR|ITL\sBulletin|White\sPaper))\s/, code),
78
75
  code: match(/(?<val>[0-9-]{3,}[A-Z]?)/, code),
79
76
  prt: match(/(?:pt|\sPart\s)(?<val>\d+)/, code),
@@ -86,7 +83,6 @@ module RelatonNist
86
83
  # (?:\s(?<rev2>Rev\.\s\d+))?
87
84
  add: match(/\sAdd(?:endum)?(?<val>\d*)/, code),
88
85
  draft: !match(/\((?:Retired\s)?Draft\)/, code).nil?,
89
- res: match(/(?<=\s)RES/, text),
90
86
  }
91
87
  end
92
88
 
@@ -95,7 +91,7 @@ module RelatonNist
95
91
 
96
92
  id = json["doi"].split("/").last
97
93
  {
98
- prefix: match(/^(?:NIST|NBS)\./, id),
94
+ # prefix: match(/^(?:NIST|NBS)\./, id),
99
95
  series: match(/(?:SP|FIPS|IR|ITL\sBulletin|White\sPaper)(?=\.)/, id),
100
96
  code: match(/(?<=\.)\d{3,}(?:-\d+)*(?:[[:alpha:]](?!\d|raft|er|t?\d))?/, id),
101
97
  prt: match(/pt?(?<val>\d+)/, id),
@@ -123,7 +119,6 @@ module RelatonNist
123
119
  rev: match(/(?:(?:(?<dl>\.)|[^a-z])r|\sRev\.\s)(?(<dl>)-)(?<val>\d+)/, text),
124
120
  add: match(/(?:(?<dl>\.)?add|\/Add)(?(<dl>)-)(?<val>\d*)/, text),
125
121
  draft: !(match(/\((?:Draft|PD)\)/, text).nil? && @opts[:stage].nil?),
126
- res: match(/(?<=\s)RES/, text),
127
122
  # prt2: match(/(?<=\s)Part\s[A-Z\d]+/, text),
128
123
  # vol2: match(/(?<=\s)Vol\.\s\d+/, text),
129
124
  # ver2: match(/(?<=\s)Ver\.\s\d+/, text),
@@ -120,7 +120,7 @@ module RelatonNist
120
120
  #
121
121
  def ref_attrs
122
122
  docidentifier.detect(&:primary)&.tap do |di|
123
- return { anchor: di.id.gsub(" ", ".") }
123
+ return { anchor: di.id.gsub(" ", ".").squeeze(".") }
124
124
  end
125
125
  end
126
126
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonNist
2
- VERSION = "1.14.4".freeze
2
+ VERSION = "1.14.5".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.14.4
4
+ version: 1.14.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-03 00:00:00.000000000 Z
11
+ date: 2023-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: relaton-bib