commonmeta-ruby 3.3.10 → 3.3.12
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 +2 -2
- data/lib/commonmeta/readers/json_feed_reader.rb +11 -6
- data/lib/commonmeta/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/wordpress_post_with_many_references.yml +2993 -0
- data/spec/readers/json_feed_reader_spec.rb +26 -0
- metadata +3 -2
@@ -348,6 +348,32 @@ describe Commonmeta::Metadata, vcr: true do
|
|
348
348
|
expect(subject.references).to be_nil
|
349
349
|
end
|
350
350
|
|
351
|
+
it "wordpress post with many references" do
|
352
|
+
input = "https://rogue-scholar.org/api/posts/f3dc29da-0481-4f3b-8110-4c07260fca67"
|
353
|
+
subject = described_class.new(input: input)
|
354
|
+
expect(subject.valid?).to be true
|
355
|
+
expect(subject.id).to eq("https://flavoursofopen.science/grundlagen-fur-die-entwicklung-einer-open-scholarship-strategie")
|
356
|
+
expect(subject.url).to eq("https://flavoursofopen.science/grundlagen-fur-die-entwicklung-einer-open-scholarship-strategie")
|
357
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "f3dc29da-0481-4f3b-8110-4c07260fca67", "alternateIdentifierType" => "UUID" }])
|
358
|
+
expect(subject.type).to eq("Article")
|
359
|
+
expect(subject.creators.length).to eq(1)
|
360
|
+
expect(subject.creators.first).to eq("familyName"=>"Steiner", "givenName"=>"Tobias", "id"=>"https://orcid.org/0000-0002-3158-3136", "type"=>"Person")
|
361
|
+
expect(subject.titles).to eq([{ "title" => "Grundlagen für die Entwicklung einer Open Scholarship-Strategie" }])
|
362
|
+
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
363
|
+
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
364
|
+
expect(subject.date).to eq("published"=>"2019-01-31", "updated"=>"2023-06-19")
|
365
|
+
expect(subject.descriptions.first["description"]).to start_with("Versionshistorie Version 1.0 — 16. Oktober 2017 – Erste Version des Dokuments")
|
366
|
+
expect(subject.publisher).to eq("name" => "Flavours of Open")
|
367
|
+
expect(subject.subjects).to eq([{ "subject" => "Humanities" },
|
368
|
+
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
369
|
+
"subject" => "FOS: Humanities",
|
370
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
371
|
+
expect(subject.language).to eq("de")
|
372
|
+
expect(subject.container).to eq("identifier" => "https://flavoursofopen.science", "identifierType" => "URL", "title" => "Flavours of Open", "type" => "Periodical")
|
373
|
+
expect(subject.references.length).to eq(55)
|
374
|
+
expect(subject.references.first).to eq("key" => "ref1", "url" => "http://oerstrategy.org/home/read-the-doc")
|
375
|
+
end
|
376
|
+
|
351
377
|
it "substack post with broken reference" do
|
352
378
|
input = "https://rogue-scholar.org/api/posts/2b105b29-acbc-4eae-9ff1-368803f36a4d"
|
353
379
|
subject = described_class.new(input: input)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commonmeta-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -879,6 +879,7 @@ files:
|
|
879
879
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/syldavia_gazette_post_with_references.yml
|
880
880
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/upstream_post_with_references.yml
|
881
881
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/wordpress_post.yml
|
882
|
+
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/wordpress_post_with_many_references.yml
|
882
883
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/wordpress_post_with_references.yml
|
883
884
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/wordpress_post_with_tracking_code_on_url.yml
|
884
885
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_one_author/affiliation_is_space.yml
|