commonmeta-ruby 3.8.0 → 3.8.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 +6 -2
- data/lib/commonmeta/version.rb +1 -1
- data/spec/writers/crossref_xml_writer_spec.rb +16 -17
- 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: 120ed85370f97abfff70ce77e682f54a469f04ce9be3b1397a4ca63223b8426e
|
4
|
+
data.tar.gz: da3395f12d5a81781ea465b6ca4879f3f70239667f3d203d8fefecaff2bc8c2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d8c606c1907765e252874253118e35165dfc0c7368c86c04927ee51ab8b1b5d417f08cc8fd8a8e2126e3a13175b06c344b94c4e8b35c2b99fb705ffe7c94657
|
7
|
+
data.tar.gz: c98f22a9d7f77dccc71500d91c42206332e320bf17cac6a4d994ecccee9232f490bdd2c0369e4c5100a17807a8d96890d59461515edc1b4b9772c09242515e93
|
data/Gemfile.lock
CHANGED
@@ -348,8 +348,12 @@ module Commonmeta
|
|
348
348
|
xml.collection("property" => "text-mining") do
|
349
349
|
xml.item do
|
350
350
|
xml.resource(url, "mime_type" => "text/html")
|
351
|
-
|
352
|
-
|
351
|
+
end
|
352
|
+
if is_rogue_scholar_doi?(doi)
|
353
|
+
Array.wrap(files).each do |file|
|
354
|
+
xml.item do
|
355
|
+
# Crossref schema currently doesn't support text/markdown
|
356
|
+
file["mimeType"] = "text/plain" if file["mimeType"] == "text/markdown"
|
353
357
|
xml.resource(file["url"], "mime_type" => file["mimeType"])
|
354
358
|
end
|
355
359
|
end
|
data/lib/commonmeta/version.rb
CHANGED
@@ -232,9 +232,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
232
232
|
"title")).to eq("Attempts at automating journal subject classification")
|
233
233
|
expect(crossref_xml.dig("item_number")).to eq("__content__" => "5d14ffacb9ac4e20bdc0d9248df4e80d", "item_number_type" => "uuid")
|
234
234
|
expect(crossref_xml.dig("group_title")).to eq("Humanities")
|
235
|
-
expect(crossref_xml.dig("doi_data", "collection", "item"
|
236
|
-
expect(crossref_xml.dig("doi_data", "collection", "item", "resource"
|
237
|
-
|
235
|
+
expect(crossref_xml.dig("doi_data", "collection", "item").length).to eq(4)
|
236
|
+
expect(crossref_xml.dig("doi_data", "collection", "item", 2, "resource")).to eq("__content__" => "https://api.rogue-scholar.org/posts/10.54900/n6dnt-xpq48.pdf", "mime_type" => "application/pdf")
|
238
237
|
end
|
239
238
|
|
240
239
|
it "json_feed_item with references" do
|
@@ -267,8 +266,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
267
266
|
expect(crossref_xml.dig("citation_list", "citation").last).to eq("article_title" => "The Research Software Alliance (ReSA) and the community landscape", "cYear" => "2020", "doi" => "10.5281/zenodo.3699950", "key" => "ref11")
|
268
267
|
expect(crossref_xml.dig("item_number")).to eq("__content__" => "954f81380ecd409087c5cef1297f1470", "item_number_type" => "uuid")
|
269
268
|
expect(crossref_xml.dig("group_title")).to eq("Humanities")
|
270
|
-
expect(crossref_xml.dig("doi_data", "collection", "item"
|
271
|
-
expect(crossref_xml.dig("doi_data", "collection", "item", "resource"
|
269
|
+
expect(crossref_xml.dig("doi_data", "collection", "item").length).to eq(4)
|
270
|
+
expect(crossref_xml.dig("doi_data", "collection", "item", 2, "resource")).to eq("__content__" => "https://api.rogue-scholar.org/posts/10.54900/zwm7q-vet94.pdf", "mime_type" => "application/pdf")
|
272
271
|
end
|
273
272
|
|
274
273
|
it "json_feed_item from rogue scholar with doi" do
|
@@ -298,8 +297,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
298
297
|
"title")).to eq("EU-Mitgliedstaaten betonen die Rolle von wissenschaftsgeleiteten Open-Access-Modellen jenseits von APCs")
|
299
298
|
expect(crossref_xml.dig("item_number")).to eq("__content__" => "1c57855813244493b8af84c49eabc52f", "item_number_type" => "uuid")
|
300
299
|
expect(crossref_xml.dig("group_title")).to eq("Social sciences")
|
301
|
-
expect(crossref_xml.dig("doi_data", "collection", "item"
|
302
|
-
expect(crossref_xml.dig("doi_data", "collection", "item", "resource"
|
300
|
+
expect(crossref_xml.dig("doi_data", "collection", "item").length).to eq(4)
|
301
|
+
expect(crossref_xml.dig("doi_data", "collection", "item", 2, "resource")).to eq("__content__" => "https://api.rogue-scholar.org/posts/10.59350/9ry27-7cz42.pdf", "mime_type" => "application/pdf")
|
303
302
|
end
|
304
303
|
|
305
304
|
it "json_feed_item from rogue scholar with organizational author" do
|
@@ -328,8 +327,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
328
327
|
"title")).to eq("KU Leuven supports ResearchEquals")
|
329
328
|
expect(crossref_xml.dig("item_number")).to eq("__content__" => "5561f8e42ff14186a8d58dacb3afe414", "item_number_type" => "uuid")
|
330
329
|
expect(crossref_xml.dig("group_title")).to eq("Social sciences")
|
331
|
-
expect(crossref_xml.dig("doi_data", "collection", "item"
|
332
|
-
expect(crossref_xml.dig("doi_data", "collection", "item", "resource"
|
330
|
+
expect(crossref_xml.dig("doi_data", "collection", "item").length).to eq(4)
|
331
|
+
expect(crossref_xml.dig("doi_data", "collection", "item", 2, "resource")).to eq("__content__" => "https://api.rogue-scholar.org/posts/10.59350/9ry27-7cz42.pdf", "mime_type" => "application/pdf")
|
333
332
|
end
|
334
333
|
|
335
334
|
it "json_feed_item from rogue scholar with archived content" do
|
@@ -369,8 +368,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
369
368
|
"title")).to eq("ORCID Integration Series: PANGAEA")
|
370
369
|
expect(crossref_xml.dig("item_number")).to eq("__content__" => "570c8129e86749e68517bd783627e76e", "item_number_type" => "uuid")
|
371
370
|
expect(crossref_xml.dig("group_title")).to eq("Computer and information sciences")
|
372
|
-
expect(crossref_xml.dig("doi_data", "collection", "item"
|
373
|
-
expect(crossref_xml.dig("doi_data", "collection", "item", "resource"
|
371
|
+
expect(crossref_xml.dig("doi_data", "collection", "item").length).to eq(4)
|
372
|
+
expect(crossref_xml.dig("doi_data", "collection", "item", 2, "resource")).to eq("__content__" => "https://api.rogue-scholar.org/posts/10.59350/faeph-x4x84.pdf", "mime_type" => "application/pdf")
|
374
373
|
end
|
375
374
|
|
376
375
|
it "json_feed_item from rogue scholar with relations" do
|
@@ -408,8 +407,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
408
407
|
"title")).to eq("Differences between ORCID and DataCite Metadata")
|
409
408
|
expect(crossref_xml.dig("item_number")).to eq("__content__" => "8a4de44333474b82b57de3c82b6485fc", "item_number_type" => "uuid")
|
410
409
|
expect(crossref_xml.dig("group_title")).to eq("Computer and information sciences")
|
411
|
-
expect(crossref_xml.dig("doi_data", "collection", "item"
|
412
|
-
expect(crossref_xml.dig("doi_data", "collection", "item", "resource"
|
410
|
+
expect(crossref_xml.dig("doi_data", "collection", "item").length).to eq(4)
|
411
|
+
expect(crossref_xml.dig("doi_data", "collection", "item", 2, "resource")).to eq("__content__" => "https://api.rogue-scholar.org/posts/10.53731/r79v4e1-97aq74v-ag578.pdf", "mime_type" => "application/pdf")
|
413
412
|
end
|
414
413
|
|
415
414
|
it "json_feed_item from rogue scholar with relations and funding" do
|
@@ -446,8 +445,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
446
445
|
"title")).to eq("Tracking the Growth of the PID Graph")
|
447
446
|
expect(crossref_xml.dig("item_number")).to eq("__content__" => "e58dc9c8b8704db28896238b3246c551", "item_number_type" => "uuid")
|
448
447
|
expect(crossref_xml.dig("group_title")).to eq("Computer and information sciences")
|
449
|
-
expect(crossref_xml.dig("doi_data", "collection", "item"
|
450
|
-
expect(crossref_xml.dig("doi_data", "collection", "item", "resource"
|
448
|
+
expect(crossref_xml.dig("doi_data", "collection", "item").length).to eq(4)
|
449
|
+
expect(crossref_xml.dig("doi_data", "collection", "item", 2, "resource")).to eq("__content__" => "https://api.rogue-scholar.org/posts/10.53731/r79s4nh-97aq74v-ag4t1.pdf", "mime_type" => "application/pdf")
|
451
450
|
end
|
452
451
|
|
453
452
|
it "json_feed_item from rogue scholar with anonymous author" do
|
@@ -481,8 +480,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
481
480
|
"title")).to eq("Welcome to the Lab")
|
482
481
|
expect(crossref_xml.dig("item_number")).to eq("__content__" => "a163e3405b3c47369ab08c54fdff6a3c", "item_number_type" => "uuid")
|
483
482
|
expect(crossref_xml.dig("group_title")).to eq("Computer and information sciences")
|
484
|
-
expect(crossref_xml.dig("doi_data", "collection", "item"
|
485
|
-
expect(crossref_xml.dig("doi_data", "collection", "item", "resource"
|
483
|
+
expect(crossref_xml.dig("doi_data", "collection", "item").length).to eq(4)
|
484
|
+
expect(crossref_xml.dig("doi_data", "collection", "item", 2, "resource")).to eq("__content__" => "https://api.rogue-scholar.org/posts/10.59350/9ry27-7cz42.pdf", "mime_type" => "application/pdf")
|
486
485
|
end
|
487
486
|
end
|
488
487
|
end
|