bolognese 0.9.16 → 0.9.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bolognese/readers/datacite_reader.rb +1 -1
- data/lib/bolognese/utils.rb +1 -1
- data/lib/bolognese/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/empty_subject.yml +99 -0
- data/spec/readers/datacite_reader_spec.rb +16 -0
- data/spec/writers/citeproc_writer_spec.rb +4 -4
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4bf575907432b4cceb0c59f18c11f46f8d8a048
|
4
|
+
data.tar.gz: 2688d21093927a3153ab67b8d492e18900b2d524
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e8af10f8bd60543bff089d952d4325b78986d5d6240d5555b6fd820331074da0f575fc451b1aeab07658ad1f07ea649ac4a7cd704f8a2b063d50a0072c646f8
|
7
|
+
data.tar.gz: 552874744bd870c5a108593862bc9778bf80bd7c24673f2d62014685a5d01a135b41ca42fdf23025a749dae63bbc59ce523440f846bde7e0788cb4e3ef11f426
|
data/Gemfile.lock
CHANGED
data/lib/bolognese/utils.rb
CHANGED
@@ -420,7 +420,7 @@ module Bolognese
|
|
420
420
|
a["given"] = a["givenName"]
|
421
421
|
a["literal"] = a["name"] unless a["familyName"].present?
|
422
422
|
a.except("type", "@type", "id", "@id", "name", "familyName", "givenName").compact
|
423
|
-
end
|
423
|
+
end
|
424
424
|
end
|
425
425
|
|
426
426
|
def to_ris(element)
|
data/lib/bolognese/version.rb
CHANGED
@@ -0,0 +1,99 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.datacite.org/prefixes/10.18169
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Maremma - https://github.com/datacite/maremma
|
12
|
+
Accept:
|
13
|
+
- text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: ''
|
18
|
+
headers:
|
19
|
+
Access-Control-Allow-Headers:
|
20
|
+
- Content-Type,Accept,Accept-Encoding,Origin,User-Agent,Cache-Control,Keep-Alive
|
21
|
+
Access-Control-Allow-Methods:
|
22
|
+
- GET, POST, OPTIONS
|
23
|
+
Access-Control-Allow-Origin:
|
24
|
+
- "*"
|
25
|
+
Access-Control-Max-Age:
|
26
|
+
- '1728000'
|
27
|
+
Cache-Control:
|
28
|
+
- max-age=0, private, must-revalidate
|
29
|
+
Content-Type:
|
30
|
+
- application/vnd.api+json; charset=utf-8
|
31
|
+
Date:
|
32
|
+
- Mon, 08 May 2017 16:13:02 GMT
|
33
|
+
Etag:
|
34
|
+
- W/"b8e8c74c8d2edc7cfc1ceedfe0458b59"
|
35
|
+
Server:
|
36
|
+
- openresty/1.11.2.2
|
37
|
+
Status:
|
38
|
+
- 200 OK
|
39
|
+
Vary:
|
40
|
+
- Accept-Encoding
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Frame-Options:
|
44
|
+
- SAMEORIGIN
|
45
|
+
X-Powered-By:
|
46
|
+
- Phusion Passenger 5.1.2
|
47
|
+
X-Request-Id:
|
48
|
+
- 45b80e41-aa23-4d99-82a8-3a4c1883a1ad
|
49
|
+
X-Runtime:
|
50
|
+
- '0.636173'
|
51
|
+
X-Xss-Protection:
|
52
|
+
- 1; mode=block
|
53
|
+
Content-Length:
|
54
|
+
- '125'
|
55
|
+
Connection:
|
56
|
+
- keep-alive
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"data":{"id":"10.18169","type":"prefixes","attributes":{"registration-agency":"DataCite","updated":"2016-09-21T20:25:36Z"}}}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Mon, 08 May 2017 16:13:02 GMT
|
62
|
+
- request:
|
63
|
+
method: get
|
64
|
+
uri: https://search.datacite.org/api?fl=doi,xml,media,minted,updated&q=doi:10.18169/papdeottx00502&wt=json
|
65
|
+
body:
|
66
|
+
encoding: US-ASCII
|
67
|
+
string: ''
|
68
|
+
headers:
|
69
|
+
User-Agent:
|
70
|
+
- Maremma - https://github.com/datacite/maremma
|
71
|
+
Accept:
|
72
|
+
- text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
|
73
|
+
response:
|
74
|
+
status:
|
75
|
+
code: 200
|
76
|
+
message: ''
|
77
|
+
headers:
|
78
|
+
Access-Control-Allow-Methods:
|
79
|
+
- GET, POST, OPTIONS
|
80
|
+
Access-Control-Allow-Origin:
|
81
|
+
- "*"
|
82
|
+
Content-Type:
|
83
|
+
- application/json;charset=UTF-8
|
84
|
+
Date:
|
85
|
+
- Mon, 08 May 2017 16:13:02 GMT
|
86
|
+
Server:
|
87
|
+
- openresty/1.11.2.2
|
88
|
+
Content-Length:
|
89
|
+
- '1759'
|
90
|
+
Connection:
|
91
|
+
- keep-alive
|
92
|
+
body:
|
93
|
+
encoding: UTF-8
|
94
|
+
string: '{"responseHeader":{"status":0,"QTime":1},"response":{"numFound":1,"start":0,"docs":[{"xml":"PHJlc291cmNlIHhtbG5zPSJodHRwOi8vZGF0YWNpdGUub3JnL3NjaGVtYS9rZXJuZWwtMyIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgeHNpOnNjaGVtYUxvY2F0aW9uPSJodHRwOi8vZGF0YWNpdGUub3JnL3NjaGVtYS9rZXJuZWwtMyBodHRwOi8vc2NoZW1hLmRhdGFjaXRlLm9yZy9tZXRhL2tlcm5lbC0zL21ldGFkYXRh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ZXM+DTxmb3JtYXRzPg08Zm9ybWF0PlBERjwvZm9ybWF0Pg08L2Zvcm1hdHM+DTx2ZXJzaW9uPjE8L3ZlcnNpb24+DTxkZXNjcmlwdGlvbnM+DTxkZXNjcmlwdGlvbiBkZXNjcmlwdGlvblR5cGU9IkFic3RyYWN0Ij4NPC9kZXNjcmlwdGlvbj4NPC9kZXNjcmlwdGlvbnM+DTwvcmVzb3VyY2U+DQ==","minted":"2017-04-07T11:11:49Z","updated":"2017-04-07T11:11:49Z","doi":"10.18169/PAPDEOTTX00502"}]}}
|
95
|
+
|
96
|
+
'
|
97
|
+
http_version:
|
98
|
+
recorded_at: Mon, 08 May 2017 16:13:02 GMT
|
99
|
+
recorded_with: VCR 3.0.3
|
@@ -203,6 +203,22 @@ describe Bolognese::Metadata, vcr: true do
|
|
203
203
|
expect(subject.provider).to eq("DataCite")
|
204
204
|
end
|
205
205
|
|
206
|
+
it "empty subject" do
|
207
|
+
input = "https://doi.org/10.18169/PAPDEOTTX00502"
|
208
|
+
subject = Bolognese::Metadata.new(input: input)
|
209
|
+
expect(subject.valid?).to be true
|
210
|
+
expect(subject.id).to eq("https://doi.org/10.18169/papdeottx00502")
|
211
|
+
expect(subject.type).to eq("Dataset")
|
212
|
+
expect(subject.additional_type).to eq("Disclosure")
|
213
|
+
expect(subject.resource_type_general).to eq("Dataset")
|
214
|
+
expect(subject.author).to eq("name"=>"Anonymous")
|
215
|
+
expect(subject.title).to eq( "Messung der Bildunschaerfe in H.264-codierten Bildern und Videosequenzen")
|
216
|
+
expect(subject.date_published).to eq("2017")
|
217
|
+
expect(subject.publisher).to eq("Siemens AG")
|
218
|
+
expect(subject.provider).to eq("DataCite")
|
219
|
+
expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
|
220
|
+
end
|
221
|
+
|
206
222
|
# it "missing creator" do
|
207
223
|
# string = IO.read(fixture_path + "datacite_missing_creator.xml")
|
208
224
|
# subject = Bolognese::Metadata.new(string: string, regenerate: true)
|
@@ -32,7 +32,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
32
32
|
expect(json["id"]).to eq("https://doi.org/10.5438/4k3m-nyvg")
|
33
33
|
expect(json["DOI"]).to eq("10.5438/4k3m-nyvg")
|
34
34
|
expect(json["title"]).to eq("Eating your own Dog Food")
|
35
|
-
expect(json["author"]).to eq("family"=>"Fenner", "given"=>"Martin")
|
35
|
+
expect(json["author"]).to eq([{"family"=>"Fenner", "given"=>"Martin"}])
|
36
36
|
expect(json["publisher"]).to eq("DataCite")
|
37
37
|
expect(json["issued"]).to eq("date-parts"=>[[2016, 12, 20]])
|
38
38
|
end
|
@@ -45,7 +45,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
45
45
|
expect(json["id"]).to eq("https://doi.org/10.5438/4k3m-nyvg")
|
46
46
|
expect(json["DOI"]).to eq("10.5438/4K3M-NYVG")
|
47
47
|
expect(json["title"]).to eq("Eating your own Dog Food")
|
48
|
-
expect(json["author"]).to eq("family"
|
48
|
+
expect(json["author"]).to eq([{"family"=>"Fenner", "given"=>"Martin"}])
|
49
49
|
expect(json["publisher"]).to eq("DataCite")
|
50
50
|
expect(json["issued"]).to eq("date-parts" => [[2016, 12, 20]])
|
51
51
|
end
|
@@ -58,7 +58,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
58
58
|
expect(json["id"]).to eq("https://doi.org/10.5438/4k3m-nyvg")
|
59
59
|
expect(json["DOI"]).to eq("10.5438/4k3m-nyvg")
|
60
60
|
expect(json["title"]).to eq("Eating your own Dog Food")
|
61
|
-
expect(json["author"]).to eq("family"
|
61
|
+
expect(json["author"]).to eq([{"family"=>"Fenner", "given"=>"Martin"}])
|
62
62
|
expect(json["publisher"]).to eq("DataCite")
|
63
63
|
expect(json["issued"]).to eq("date-parts" => [[2016, 12, 20]])
|
64
64
|
end
|
@@ -130,7 +130,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
130
130
|
expect(json["id"]).to eq("https://doi.org/10.5438/qeg0-3gm3")
|
131
131
|
expect(json["DOI"]).to eq("10.5438/qeg0-3gm3")
|
132
132
|
expect(json["title"]).to eq("Maremma: a Ruby library for simplified network calls")
|
133
|
-
expect(json["author"]).to eq("family"
|
133
|
+
expect(json["author"]).to eq([{"family"=>"Fenner", "given"=>"Martin"}])
|
134
134
|
expect(json["publisher"]).to eq("DataCite")
|
135
135
|
expect(json["issued"]).to eq("date-parts" => [[2017, 2, 24]])
|
136
136
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bolognese
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
@@ -593,6 +593,7 @@ files:
|
|
593
593
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_only_full_name.yml
|
594
594
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_with_scheme.yml
|
595
595
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/date.yml
|
596
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/empty_subject.yml
|
596
597
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/funding_schema_version_3.yml
|
597
598
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/is_identical_to.yml
|
598
599
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/keywords_with_attributes.yml
|