commonmeta-ruby 3.4.0 → 3.4.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/Gemfile.lock +1 -1
- data/lib/commonmeta/crossref_utils.rb +10 -8
- data/lib/commonmeta/version.rb +1 -1
- data/spec/writers/crossref_xml_writer_spec.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e7e0078d9ee8268350debef90ecae5249f626498dc89630a1671a2edd16e4fc
|
4
|
+
data.tar.gz: a9265add9afeb7a302503da01875574d0ff999e2f93928ed324fabd5e0faaacc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c248850455ab14549458e9fbaa46309d03a0cfdd9836ecdaf2681eba606c5036480a66c4458c3b5fd140632fd1e8b4b7b1bcce79bfbf997cb694ba8dc974d66a
|
7
|
+
data.tar.gz: 5ae480537efd8c91dbeb013ff071189b340bc13e6a34b784c1a1d9af699dd2b0a123029758c1018ac40d921bd0444829d7b40938d89acf85ebd189228cb9226b
|
data/Gemfile.lock
CHANGED
@@ -205,14 +205,16 @@ module Commonmeta
|
|
205
205
|
xml.program("xmlns" => "http://www.crossref.org/relations.xsd",
|
206
206
|
"name" => "relations") do
|
207
207
|
related_identifiers.each do |related_identifier|
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
208
|
+
xml.related_item do
|
209
|
+
identifier_type = validate_doi(related_identifier["id"]) ? "doi" : "uri"
|
210
|
+
id = identifier_type == "doi" ? doi_from_url(related_identifier["id"]) : related_identifier["id"]
|
211
|
+
attributes = {
|
212
|
+
"relation-type" => related_identifier["type"].camelize(:lower),
|
213
|
+
"identifier-type" => identifier_type,
|
214
|
+
}.compact
|
215
|
+
|
216
|
+
xml.intra_work_relation(id, attributes)
|
217
|
+
end
|
216
218
|
end
|
217
219
|
end
|
218
220
|
end
|
data/lib/commonmeta/version.rb
CHANGED
@@ -312,6 +312,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
312
312
|
expect(subject.container).to eq("identifier" => "https://blog.front-matter.io", "identifierType" => "URL", "title" => "Front Matter", "type" => "Periodical")
|
313
313
|
expect(subject.references).to eq([{"doi"=>"https://doi.org/10.5281/ZENODO.30799", "key"=>"ref1", "publicationYear"=>"2015", "title"=>"D2.1: Artefact, Contributor, And Organisation Relationship Data Schema"}])
|
314
314
|
expect(subject.related_identifiers).to eq([{"id"=>"https://doi.org/10.5438/bc11-cqw1", "type"=>"IsIdenticalTo"}])
|
315
|
+
# puts subject.crossref_xml
|
315
316
|
crossref_xml = Hash.from_xml(subject.crossref_xml).dig("doi_batch", "body", "posted_content")
|
316
317
|
expect(Array.wrap(crossref_xml.dig("contributors", "person_name")).length).to eq(1)
|
317
318
|
expect(Array.wrap(crossref_xml.dig("contributors",
|