relaton-nist 0.8.2 → 0.9.0
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 +10 -7
- data/lib/relaton_nist/scrapper.rb +2 -2
- data/lib/relaton_nist/version.rb +1 -1
- data/relaton_nist.gemspec +2 -2
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abd608217be8e9fa36bc9e6d387d76bcac0655cc9ae9cb2ad6dd8a10981f15ec
|
4
|
+
data.tar.gz: 80e6d48a013bb510009ffc968bb7332daac07a9858bf42895183d848c4ba7e5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d79eddb9c2a1f58fe7478c1de1d7fd4444a7db3c84b2f59b8b8f3447bedd9ee84cf55297e0b32abbaf42c632f90b7952615203fbc3d1e5c4adfff330446d8ac
|
7
|
+
data.tar.gz: d327e6358a7f2f5a3b9761c9106b17c6b04c9db026359d217a35a7d501759a26f5767bc68b6ebd01f6a04eaa95693732f34c1e1b701b1d98b6055080bfc1b89b
|
@@ -60,9 +60,12 @@ module RelatonNist
|
|
60
60
|
def nistbib_get1(code, year, opts)
|
61
61
|
result = nistbib_search_filter(code, year, opts) || (return nil)
|
62
62
|
ret = nistbib_results_filter(result, year, opts)
|
63
|
-
|
64
|
-
|
65
|
-
|
63
|
+
if ret[:ret]
|
64
|
+
warn "[relaton-nist] (\"#{code}\") found #{ret[:ret].docidentifier.first.id}"
|
65
|
+
ret[:ret]
|
66
|
+
else
|
67
|
+
fetch_ref_err(code, year, ret[:years])
|
68
|
+
end
|
66
69
|
end
|
67
70
|
|
68
71
|
# Sort through the results from RelatonNist, fetching them three at a time,
|
@@ -119,7 +122,7 @@ module RelatonNist
|
|
119
122
|
def nistbib_search_filter(code, year, opts)
|
120
123
|
docid = code.match(%r{[0-9-]{3,}}).to_s
|
121
124
|
serie = code.match(%r{(FISP|SP|NISTIR)(?=\s)})
|
122
|
-
warn "
|
125
|
+
warn "[relaton-nist] (\"#{code}\") fetching..."
|
123
126
|
result = search(code, year, opts)
|
124
127
|
result.select do |i|
|
125
128
|
i.hit[:code]&.include?(docid) && (!serie || i.hit[:serie] == serie.to_s)
|
@@ -128,12 +131,12 @@ module RelatonNist
|
|
128
131
|
|
129
132
|
def fetch_ref_err(code, year, missed_years)
|
130
133
|
id = year ? "#{code}:#{year}" : code
|
131
|
-
warn "WARNING: no match found online for #{id}. "\
|
134
|
+
warn "[relaton-nist] WARNING: no match found online for #{id}. "\
|
132
135
|
"The code must be exactly like it is on the standards website."
|
133
|
-
warn "(There was no match for #{year}, though there were matches "\
|
136
|
+
warn "[relaton-nist] (There was no match for #{year}, though there were matches "\
|
134
137
|
"found for #{missed_years.join(', ')}.)" unless missed_years.empty?
|
135
138
|
if /\d-\d/ =~ code
|
136
|
-
warn "The provided document part may not exist, or the document "\
|
139
|
+
warn "[relaton-nist] The provided document part may not exist, or the document "\
|
137
140
|
"may no longer be published in parts."
|
138
141
|
end
|
139
142
|
nil
|
@@ -235,7 +235,7 @@ module RelatonNist
|
|
235
235
|
)
|
236
236
|
end
|
237
237
|
if contr["surname"]
|
238
|
-
affiliation = RelatonBib::
|
238
|
+
affiliation = RelatonBib::Affiliation.new organization: org
|
239
239
|
entity = RelatonBib::Person.new(
|
240
240
|
name: full_name(contr, lang, script), affiliation: [affiliation],
|
241
241
|
)
|
@@ -271,7 +271,7 @@ module RelatonNist
|
|
271
271
|
url = nil
|
272
272
|
end
|
273
273
|
org = RelatonBib::Organization.new name: org_name, url: url, abbreviation: abbrev
|
274
|
-
affiliation = RelatonBib::
|
274
|
+
affiliation = RelatonBib::Affiliation.new organization: org
|
275
275
|
entity = RelatonBib::Person.new(
|
276
276
|
name: fullname, affiliation: [affiliation],
|
277
277
|
)
|
data/lib/relaton_nist/version.rb
CHANGED
data/relaton_nist.gemspec
CHANGED
@@ -29,11 +29,11 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency "rake", "~> 10.0"
|
30
30
|
spec.add_development_dependency "rspec", "~> 3.0"
|
31
31
|
spec.add_development_dependency "ruby-debug-ide"
|
32
|
+
spec.add_development_dependency "ruby-jing"
|
32
33
|
spec.add_development_dependency "simplecov"
|
33
34
|
spec.add_development_dependency "vcr"
|
34
35
|
spec.add_development_dependency "webmock"
|
35
|
-
spec.add_development_dependency "ruby-jing"
|
36
36
|
|
37
|
-
spec.add_dependency "relaton-bib", "~> 0.
|
37
|
+
spec.add_dependency "relaton-bib", "~> 0.9.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: 0.
|
4
|
+
version: 0.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: 2020-03-
|
11
|
+
date: 2020-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: ruby-jing
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: simplecov
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
@@ -123,7 +123,7 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: vcr
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - ">="
|
@@ -137,7 +137,7 @@ dependencies:
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: webmock
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - ">="
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 0.
|
159
|
+
version: 0.9.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: 0.
|
166
|
+
version: 0.9.0
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: rubyzip
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|