commonmeta-ruby 3.4.4 → 3.4.5
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/readers/json_feed_reader.rb +1 -1
- data/lib/commonmeta/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_related_identifiers_and_funding.yml +36 -36
- data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_related_identifiers_and_link_to_peer-reviewed_article.yml +4911 -0
- data/spec/readers/json_feed_reader_spec.rb +26 -0
- metadata +2 -1
|
@@ -79,6 +79,31 @@ describe Commonmeta::Metadata, vcr: true do
|
|
|
79
79
|
expect(subject.container).to eq("identifier" => "https://blog.front-matter.io", "identifierType" => "URL", "title" => "Front Matter", "type" => "Periodical")
|
|
80
80
|
end
|
|
81
81
|
|
|
82
|
+
it "ghost post with related_identifiers and link to peer-reviewed article" do
|
|
83
|
+
input = "https://rogue-scholar.org/api/posts/2bdebfc5-e02e-42c2-90c5-e873e2d0435d"
|
|
84
|
+
subject = described_class.new(input: input)
|
|
85
|
+
expect(subject.valid?).to be true
|
|
86
|
+
expect(subject.id).to eq("https://doi.org/10.53731/r294649-6f79289-8cw18")
|
|
87
|
+
expect(subject.url).to eq("https://blog.front-matter.io/posts/nine-simple-ways-to-make-it-easier-to-re-use-your-data")
|
|
88
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "2bdebfc5-e02e-42c2-90c5-e873e2d0435d", "alternateIdentifierType" => "UUID" }])
|
|
89
|
+
expect(subject.type).to eq("Article")
|
|
90
|
+
expect(subject.creators.length).to eq(1)
|
|
91
|
+
expect(subject.creators.first).to eq("id" => "https://orcid.org/0000-0003-1419-2405", "familyName" => "Fenner", "givenName" => "Martin", "type" => "Person")
|
|
92
|
+
expect(subject.titles).to eq([{ "title" => "Nine simple ways to make it easier to (re)use your data" }])
|
|
93
|
+
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
|
94
|
+
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
|
95
|
+
expect(subject.date).to eq("published" => "2013-06-25", "updated" => "2023-09-07")
|
|
96
|
+
expect(subject.descriptions.first["description"]).to start_with("This paper in markdown format was written by Ethan White et al.")
|
|
97
|
+
expect(subject.publisher).to eq("name" => "Front Matter")
|
|
98
|
+
expect(subject.related_identifiers).to eq([{"id"=>"https://doi.org/10.4033/iee.2013.6b.6.f", "type"=>"IsPreprintOf"}])
|
|
99
|
+
expect(subject.subjects).to eq([{ "subject" => "Computer and information sciences" },
|
|
100
|
+
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
|
101
|
+
"subject" => "FOS: Computer and information sciences",
|
|
102
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
|
103
|
+
expect(subject.language).to eq("en")
|
|
104
|
+
expect(subject.container).to eq("identifier" => "https://blog.front-matter.io", "identifierType" => "URL", "title" => "Front Matter", "type" => "Periodical")
|
|
105
|
+
end
|
|
106
|
+
|
|
82
107
|
it "ghost post with related_identifiers and funding" do
|
|
83
108
|
input = "https://rogue-scholar.org/api/posts/e58dc9c8-b870-4db2-8896-238b3246c551"
|
|
84
109
|
subject = described_class.new(input: input)
|
|
@@ -104,6 +129,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
|
104
129
|
expect(subject.language).to eq("en")
|
|
105
130
|
expect(subject.container).to eq("identifier" => "https://blog.front-matter.io", "identifierType" => "URL", "title" => "Front Matter", "type" => "Periodical")
|
|
106
131
|
end
|
|
132
|
+
|
|
107
133
|
it "ghost post without doi" do
|
|
108
134
|
input = "https://rogue-scholar.org/api/posts/c3095752-2af0-40a4-a229-3ceb7424bce2"
|
|
109
135
|
subject = described_class.new(input: input)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: commonmeta-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.4.
|
|
4
|
+
version: 3.4.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Martin Fenner
|
|
@@ -875,6 +875,7 @@ files:
|
|
|
875
875
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_organizational_author.yml
|
|
876
876
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_related_identifiers.yml
|
|
877
877
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_related_identifiers_and_funding.yml
|
|
878
|
+
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_related_identifiers_and_link_to_peer-reviewed_article.yml
|
|
878
879
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_without_doi.yml
|
|
879
880
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/jekyll_post.yml
|
|
880
881
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/jekyll_post_with_anonymous_author.yml
|