relaton-nist 1.10.1 → 1.10.2

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: d843669047c6d1d170c7cf1e4ec20947cdb90bd888370d7f1bcab3e5eb5b7ab0
4
- data.tar.gz: c4c62956580641d0d71ff70cc848803b203d76418e8cdb8b64f572d880f620a2
3
+ metadata.gz: 697ffbbaa6448eea164b59de95e1244955e83fe7520b997bceed7b588db9b6fb
4
+ data.tar.gz: 01cf4ad824fb4f89b29ab6e052835a0bfdc9519f9e0bdf8366470cbb6771c52c
5
5
  SHA512:
6
- metadata.gz: 37bbd4792e8c866ed5dae0a703318dc7175946da4e91d223d0f010d4418a0da25380a59291edc7d7746cad8e36af54012d59b6b72cfad23d3c01d500b4724952
7
- data.tar.gz: e44ecec41e34b5e5bd575759e08a571eb8bd4db4e102b4bfcac2c4b17f6d20410b069468d7b55de95e49d7c4747fc57ddc71fcc43a27418ccfa50e1820907a17
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: doi(doc) },
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 doi(doc) # rubocop:disable Metrics/CyclomaticComplexity
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
- doi(doc).split("/")[1..-1].join "/"
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
- url = doc.at("doi_data/resource").text
119
- [RelatonBib::TypedUri.new(type: "doi", content: url)]
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]
@@ -1,3 +1,3 @@
1
1
  module RelatonNist
2
- VERSION = "1.10.1".freeze
2
+ VERSION = "1.10.2".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.10.1
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-02-09 00:00:00.000000000 Z
11
+ date: 2022-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml