relaton-nist 1.12.2 → 1.12.3

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: 81b3111f5bb486625e9b8028bd607a00de151487d9b7114d88ba54f219b7cd07
4
- data.tar.gz: df54cc75c2228c28ce4e04e1faddbb672446560c99aad3f804308fd1a7eb57eb
3
+ metadata.gz: ef6eeb64c2dba6079789c3192b6c335f3726af48bd43b580bc5c05cf8c8b12f9
4
+ data.tar.gz: c58fa9cf63309bd404ad04797b92f1dd3f2cc0635cb061ee1211cfc9bf8e841c
5
5
  SHA512:
6
- metadata.gz: 2776eebb515b1ddbdb72f3ce4f31df912e2b2eb92eb7d6200462686d48676f17473e1668050fc4397cab720b1ff4e24b10b45df3cc8623413dfe0e75212f480c
7
- data.tar.gz: 14c30c1e0f58c26075e55a0f7c3ded41cac1a4122844fb11efe3cf1052b13048ceada426bfa0983bd28ef6b9f29b3e508ffbe7a405ea222b7885c8273b9db794
6
+ metadata.gz: b59ef8bf5ce4d0b637cb0072cb6d18c4ddbfa07170a95095df0ed95395039c19cc2f59b9a28d852dd59f357e204b3ec50c8825fb30f5049106edc0705696b6da
7
+ data.tar.gz: 22e2b8ede68f9cdd45bd921d06ba4f36c824bbc8115f3a40960d8b9f8c6f03efa8ff20d310771f8b4db30a388794654fd9e58313f6e10f4677b0945f4b67e8f8
@@ -14,7 +14,8 @@ module RelatonNist
14
14
  # @param text [String]
15
15
  # @return [RelatonNist::HitCollection]
16
16
  def search(text, year = nil, opts = {})
17
- HitCollection.search text, year, opts
17
+ ref = text.sub(/^NIST\sIR/, "NISTIR")
18
+ HitCollection.search ref, year, opts
18
19
  rescue OpenURI::HTTPError, SocketError, OpenSSL::SSL::SSLError => e
19
20
  raise RelatonBib::RequestError, e.message
20
21
  end
@@ -160,7 +161,7 @@ module RelatonNist
160
161
  # (\.(?<rev1>r-\d+))?
161
162
  # }x.match(code)
162
163
  matches = {
163
- serie: match(/(SP|FIPS|(NIST)?IR|ITL\sBulletin|White\sPaper)(?=\.|\s)/, code),
164
+ serie: match(/(SP|FIPS|(NIST)?\s?IR|ITL\sBulletin|White\sPaper)(?=\.|\s)/, code),
164
165
  code: match(/(?<=\.|\s)[0-9-]{3,}[A-Z]?/, code),
165
166
  prt1: match(/(?<=(\.))?pt(?(1)-)[A-Z\d]+/, code),
166
167
  vol1: match(/(?<=(\.))?v(?(1)-)\d+/, code),
@@ -198,25 +199,25 @@ module RelatonNist
198
199
  # @return [Boolean]
199
200
  def search_filter(item, matches, text) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
200
201
  %r{
201
- ^((?:NIST)\s)?
202
- ((?<serie>(SP|FIPS|NISTIR|ITL\sBulletin|White\sPaper))\s)?
202
+ ^(?:(?:NIST)\s)?
203
+ (?:(?<serie>(?:SP|FIPS|NISTIR|ITL\sBulletin|White\sPaper))\s)?
203
204
  (?<code>[0-9-]{3,}[A-Z]?)
204
205
  (?<prt1>pt\d+)?
205
206
  (?<vol1>v\d+)?
206
207
  (?<ver1>ver[\d.]+)?
207
208
  (?<rev1>r\d+)?
208
- (\s(?<prt2>Part\s\d+))?
209
- (\s(?<vol2>Vol\.\s\d+))?
210
- (\s(?<ver2>(Ver\.|Version)\s[\d.]+))?
211
- (\s(?<rev2>Rev\.\s\d+))?
212
- (\s(?<add>Add)endum)?
209
+ (?:\s(?<prt2>Part\s\d+))?
210
+ (?:\s(?<vol2>Vol\.\s\d+))?
211
+ (?:\s(?<ver2>(?:Ver\.|Version)\s[\d.]+))?
212
+ (?:\s(?<rev2>Rev\.\s\d+))?
213
+ (?:\s(?<add>Add)endum)?
213
214
  }x =~ item.hit[:code]
214
- matches[:code] && [serie, item.hit[:serie]].include?(matches[:serie]) && matches[:code] == code &&
215
+ (matches[:code] && [serie, item.hit[:serie]].include?(matches[:serie]) && matches[:code] == code &&
215
216
  long_to_short(matches[:prt1], matches[:prt2]) == long_to_short(prt1, prt2) &&
216
217
  long_to_short(matches[:vol1], matches[:vol2]) == long_to_short(vol1, vol2) &&
217
218
  long_to_short(matches[:ver1], matches[:ver2]) == long_to_short(ver1, ver2) &&
218
219
  long_to_short(matches[:rev1], matches[:rev2]) == long_to_short(rev1, rev2) &&
219
- long_to_short(matches[:add1], matches[:add2]) == add || item.hit[:title].include?(text.sub(/^NIST\s/, ""))
220
+ long_to_short(matches[:add1], matches[:add2]) == add) || item.hit[:title]&.include?(text.sub(/^NIST\s/, ""))
220
221
  end
221
222
 
222
223
  # @param short [String]
@@ -1,3 +1,3 @@
1
1
  module RelatonNist
2
- VERSION = "1.12.2".freeze
2
+ VERSION = "1.12.3".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.12.2
4
+ version: 1.12.3
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-07-02 00:00:00.000000000 Z
11
+ date: 2022-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml