relaton-nist 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_nist/nist_bibliography.rb +16 -7
- data/lib/relaton_nist/scrapper.rb +2 -1
- data/lib/relaton_nist/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86fbfc1190f5174be69a4e51bb6b791328c1d432143e8eb6d2aab6f644ae5100
|
4
|
+
data.tar.gz: 2aa468017a4bcf5ab9369e2f4fca85543fd641ac5ba2b35399e60e96769c996d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bb703e914559d9e8359ef6442f089d76fb3dc84fedb273e046893989b7e035825d7990235e1b9c95f14f1c916e0ffff24d9cc1e6b177ae027bcc403480ac2be
|
7
|
+
data.tar.gz: b1b0857eff72431fb9ae953af25dfedd49a1fa459b05fdd85c2285e642182ceb3a58d407bdcd8986153fad5f9f162e6115bd0c9d804d2956ed65de700d830158
|
@@ -29,15 +29,15 @@ module RelatonNist
|
|
29
29
|
#
|
30
30
|
# @return [String] Relaton XML serialisation of reference
|
31
31
|
def get(code, year = nil, opts = {})
|
32
|
-
return fetch_ref_err(code, year, []) if code
|
32
|
+
return fetch_ref_err(code, year, []) if code.match? /\sEP$/
|
33
33
|
|
34
34
|
/^(?<code2>[^\(]+)(\((?<date2>\w+\s(\d{2},\s)?\d{4})\))?\s?\(?((?<=\()(?<stage>[^\)]+))?/ =~ code
|
35
35
|
if code2
|
36
36
|
code = code2.strip
|
37
37
|
if date2
|
38
|
-
if /\w+\s\d{4}
|
38
|
+
if /\w+\s\d{4}/.match? date2
|
39
39
|
opts[:issued_date] = Date.strptime date2, "%B %Y"
|
40
|
-
elsif /\w+\s\d{2},\s\d{4}
|
40
|
+
elsif /\w+\s\d{2},\s\d{4}/.match? date2
|
41
41
|
opts[:updated_date] = Date.strptime date2, "%B %d, %Y"
|
42
42
|
end
|
43
43
|
end
|
@@ -125,13 +125,22 @@ module RelatonNist
|
|
125
125
|
end
|
126
126
|
|
127
127
|
def nistbib_search_filter(code, year, opts)
|
128
|
-
|
129
|
-
|
130
|
-
|
128
|
+
%r{
|
129
|
+
^((?:NIST)\s)?
|
130
|
+
(?<serie1>(SP|FIPS|NISTIR|ITL\sBulletin|White\sPaper))\s
|
131
|
+
(?<code1>[0-9-]{3,}\w?)
|
132
|
+
(\/(?<upd1>Add))?
|
133
|
+
}x =~ code
|
131
134
|
warn "[relaton-nist] (\"#{code}\") fetching..."
|
132
135
|
result = search(code, year, opts)
|
133
136
|
result.select do |i|
|
134
|
-
|
137
|
+
%r{
|
138
|
+
^((?:NIST)\s)?
|
139
|
+
((?<serie2>(SP|FIPS|NISTIR|ITL\sBulletin|White\sPaper))\s)?
|
140
|
+
(?<code2>[0-9-]{3,}\w?)
|
141
|
+
(\s(?<upd2>Add)endum)?
|
142
|
+
}x =~ i.hit[:code]
|
143
|
+
[serie2, i.hit[:serie]].include?(serie1) && code1 == code2 && upd1 == upd2
|
135
144
|
end
|
136
145
|
end
|
137
146
|
|
@@ -110,9 +110,10 @@ module RelatonNist
|
|
110
110
|
"//div[contains(@class, 'publications-detail')]/h3"
|
111
111
|
)&.text&.strip&.sub(/(?<=\w)\([^\)]+\)$/) do |m|
|
112
112
|
" " + m.upcase
|
113
|
-
end&.squeeze(" ")&.gsub
|
113
|
+
end&.squeeze(" ")&.gsub(/ |\n|\r/, "")
|
114
114
|
end
|
115
115
|
item_ref ||= "?"
|
116
|
+
item_ref.sub! /\sAddendum$/, "-Add"
|
116
117
|
[RelatonBib::DocumentIdentifier.new(id: item_ref, type: "NIST")]
|
117
118
|
end
|
118
119
|
|
data/lib/relaton_nist/version.rb
CHANGED
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.7.
|
4
|
+
version: 1.7.1
|
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-
|
11
|
+
date: 2020-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase
|