relaton-nist 1.10.1 → 1.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/relaton_nist/data_fetcher.rb +8 -5
- 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: 697ffbbaa6448eea164b59de95e1244955e83fe7520b997bceed7b588db9b6fb
|
|
4
|
+
data.tar.gz: 01cf4ad824fb4f89b29ab6e052835a0bfdc9519f9e0bdf8366470cbb6771c52c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e9edc52477f8e5b6852794efcde512fb7106801aad5f5a408ce9439f9f6ade82a69aae4643f8a798f2478bb7fa38a8ddc63f952c54bd8637e356d4f9ff452f17
|
|
7
|
+
data.tar.gz: e95bc37a77a6fa657feacb06d33c5e5c10759743c421ad35ec4b0a60da38342036993da513a413927be638b75bcaa192a44db35e3c45de0453e373cac9afaff7
|
|
@@ -34,7 +34,7 @@ module RelatonNist
|
|
|
34
34
|
# anchor = doi.split("/")[1..-1].join "/"
|
|
35
35
|
[
|
|
36
36
|
{ type: "NIST", id: pub_id(doc), primary: true },
|
|
37
|
-
{ type: "DOI", id:
|
|
37
|
+
{ type: "DOI", id: fetch_doi(doc) },
|
|
38
38
|
{ type: "NIST", id: anchor(doc), scope: "anchor" },
|
|
39
39
|
]
|
|
40
40
|
end
|
|
@@ -43,7 +43,7 @@ module RelatonNist
|
|
|
43
43
|
anchor(doc).gsub(".", " ")
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
def
|
|
46
|
+
def fetch_doi(doc) # rubocop:disable Metrics/CyclomaticComplexity
|
|
47
47
|
id = doc.at("doi_data/doi").text
|
|
48
48
|
case id
|
|
49
49
|
when "10.6028/NBS.CIRC.e2e" then "10.6028/NBS.CIRC.2e2"
|
|
@@ -57,7 +57,7 @@ module RelatonNist
|
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
def anchor(doc)
|
|
60
|
-
|
|
60
|
+
fetch_doi(doc).split("/")[1..-1].join "/"
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
# @param doc [Nokogiri::XML::Element]
|
|
@@ -115,8 +115,11 @@ module RelatonNist
|
|
|
115
115
|
# @param doc [Nokogiri::XML::Element]
|
|
116
116
|
# @return [Array<RelatonBib::TypedUri>]
|
|
117
117
|
def fetch_link(doc)
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
pdf = doc.at("doi_data/resource").text
|
|
119
|
+
doi = "https://doi.org/#{fetch_doi(doc)}"
|
|
120
|
+
[{ type: "doi", content: doi }, { type: "pdf", content: pdf }].map do |l|
|
|
121
|
+
RelatonBib::TypedUri.new(**l)
|
|
122
|
+
end
|
|
120
123
|
end
|
|
121
124
|
|
|
122
125
|
# @param doc [Nokogiri::XML::Element]
|
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.10.
|
|
4
|
+
version: 1.10.2
|
|
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-
|
|
11
|
+
date: 2022-04-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: equivalent-xml
|