toccatore 0.4.10 → 0.4.15
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/toccatore/base.rb +13 -2
- data/lib/toccatore/datacite_related.rb +9 -3
- data/lib/toccatore/orcid_update.rb +6 -2
- data/lib/toccatore/usage_update.rb +5 -4
- data/lib/toccatore/version.rb +1 -1
- data/spec/cli_spec.rb +1 -1
- data/spec/factories/default.rb +1 -1
- data/spec/fixtures/events_empty.json +2 -2
- data/spec/fixtures/usage_event_fail.json +1 -1
- data/spec/fixtures/usage_events.json +4 -4
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_fail_if_format_of_the_event_is_empty.yml +1 -1
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_fail_if_format_of_the_event_is_wrong.yml +4 -4
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_work_with_a_single_item.yml +1 -1
- data/spec/usage_update_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 56e3f7a50bedf097a157e0eab460c4131df5541a8ccb64c05a344ce90464060d
|
|
4
|
+
data.tar.gz: b01a010b2ac258c47c2cb705a4d122bb27f3a342dd838cdbab9c832dac66a563
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 43afaa44061b2488a5e5c0a9f243f8bd951d63f3742854c7c65522d78783b7dae2d2959bb33c818462f6e509d0da532686b9bbb1b807a7d989beeea2bbe558cf
|
|
7
|
+
data.tar.gz: 4ea332dd543c5b933a31dd3736cc87e54bf5dd967e010059e0b1975c4ad045b38536bfceef217f41a9d7db4d66602258405fae6219fbae83cb0c6eaedf2b21d9
|
data/Gemfile.lock
CHANGED
data/lib/toccatore/base.rb
CHANGED
|
@@ -72,7 +72,12 @@ module Toccatore
|
|
|
72
72
|
(0...total_pages).each do |page|
|
|
73
73
|
options[:offset] = page * job_batch_size
|
|
74
74
|
options[:total] = total
|
|
75
|
-
|
|
75
|
+
err = process_data(options)
|
|
76
|
+
if err.is_a?(Integer)
|
|
77
|
+
error_total += err
|
|
78
|
+
else
|
|
79
|
+
puts err.inspect
|
|
80
|
+
end
|
|
76
81
|
end
|
|
77
82
|
text = "#{total} works processed with #{error_total} errors for date range #{options[:from_date]} - #{options[:until_date]}."
|
|
78
83
|
else
|
|
@@ -82,7 +87,13 @@ module Toccatore
|
|
|
82
87
|
puts text
|
|
83
88
|
|
|
84
89
|
# send slack notification
|
|
85
|
-
|
|
90
|
+
if total == 0
|
|
91
|
+
options[:level] = "warning"
|
|
92
|
+
elsif error_total > 0
|
|
93
|
+
options[:level] = "danger"
|
|
94
|
+
else
|
|
95
|
+
options[:level] = "good"
|
|
96
|
+
end
|
|
86
97
|
options[:title] = "Report for #{source_id}"
|
|
87
98
|
send_notification_to_slack(text, options) if options[:slack_webhook_url].present?
|
|
88
99
|
|
|
@@ -45,7 +45,7 @@ module Toccatore
|
|
|
45
45
|
"relation_type_id" => raw_relation_type.underscore,
|
|
46
46
|
"source_id" => "datacite",
|
|
47
47
|
"source_token" => options[:source_token],
|
|
48
|
-
"occurred_at" => item.fetch("
|
|
48
|
+
"occurred_at" => item.fetch("updated"),
|
|
49
49
|
"license" => LICENSE }
|
|
50
50
|
else
|
|
51
51
|
ssum
|
|
@@ -58,7 +58,10 @@ module Toccatore
|
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def push_item(item, options={})
|
|
61
|
-
|
|
61
|
+
if options[:access_token].blank?
|
|
62
|
+
puts "Access token missing."
|
|
63
|
+
return 1
|
|
64
|
+
end
|
|
62
65
|
|
|
63
66
|
host = options[:push_url].presence || "https://bus.eventdata.crossref.org"
|
|
64
67
|
push_url = host + "/events"
|
|
@@ -74,7 +77,7 @@ module Toccatore
|
|
|
74
77
|
"relation-type-id" => item["relation_type_id"],
|
|
75
78
|
"source-id" => "datacite-crossref",
|
|
76
79
|
"source-token" => item["source_token"],
|
|
77
|
-
"occurred-at" => item["
|
|
80
|
+
"occurred-at" => item["occurred_at"],
|
|
78
81
|
"license" => item["license"] } }}
|
|
79
82
|
|
|
80
83
|
response = Maremma.post(push_url, data: data.to_json,
|
|
@@ -92,6 +95,9 @@ module Toccatore
|
|
|
92
95
|
if response.status == 201
|
|
93
96
|
puts "#{item['subj_id']} #{item['relation_type_id']} #{item['obj_id']} pushed to Event Data service."
|
|
94
97
|
0
|
|
98
|
+
elsif response.status == 409
|
|
99
|
+
puts "#{item['subj_id']} #{item['relation_type_id']} #{item['obj_id']} already pushed to Event Data service."
|
|
100
|
+
0
|
|
95
101
|
elsif response.body["errors"].present?
|
|
96
102
|
puts "#{item['subj_id']} #{item['relation_type_id']} #{item['obj_id']} had an error:"
|
|
97
103
|
puts "#{response.body['errors'].first['title']}"
|
|
@@ -44,9 +44,13 @@ module Toccatore
|
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
def push_item(item, options={})
|
|
47
|
-
|
|
47
|
+
if options[:access_token].blank?
|
|
48
|
+
puts "Access token missing."
|
|
49
|
+
return 1
|
|
50
|
+
end
|
|
48
51
|
|
|
49
|
-
|
|
52
|
+
host = options[:push_url].presence || "https://profiles.datacite.org/api"
|
|
53
|
+
push_url = host + "/claims"
|
|
50
54
|
|
|
51
55
|
response = Maremma.post(push_url, data: { "claim" => item }.to_json,
|
|
52
56
|
bearer: options[:access_token],
|
|
@@ -95,7 +95,7 @@ module Toccatore
|
|
|
95
95
|
fail "Report_id is missing" if data[:report_id].blank?
|
|
96
96
|
|
|
97
97
|
{ "uuid" => SecureRandom.uuid,
|
|
98
|
-
"message-action" => "
|
|
98
|
+
"message-action" => "create",
|
|
99
99
|
"subj-id" => data[:report_id],
|
|
100
100
|
"subj"=> {
|
|
101
101
|
"pid"=> data[:report_id],
|
|
@@ -161,10 +161,11 @@ module Toccatore
|
|
|
161
161
|
"id" => item["uuid"],
|
|
162
162
|
"type" => "events",
|
|
163
163
|
"attributes" => item.except("id") }}
|
|
164
|
+
|
|
164
165
|
response = Maremma.put(push_url, data: data.to_json,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
bearer: options[:access_token],
|
|
167
|
+
content_type: 'json',
|
|
168
|
+
host: host)
|
|
168
169
|
|
|
169
170
|
if response.status == 201
|
|
170
171
|
puts "#{item['subj-id']} #{item['relation-type-id']} #{item['obj-id']} pushed to Event Data service."
|
data/lib/toccatore/version.rb
CHANGED
data/spec/cli_spec.rb
CHANGED
data/spec/factories/default.rb
CHANGED
|
@@ -5,7 +5,7 @@ require 'securerandom'
|
|
|
5
5
|
FactoryBot.define do
|
|
6
6
|
factory :event , class: OpenStruct do
|
|
7
7
|
sequence(:uuid) { |n| "#{SecureRandom.uuid}-#{n}" }
|
|
8
|
-
message_action "
|
|
8
|
+
message_action "create"
|
|
9
9
|
sequence(:obj_id) { |n| "#{Faker::Internet.url}#{n}" }
|
|
10
10
|
sequence(:subj_id) { |n| "#{Faker::Internet.url}#{n}" }
|
|
11
11
|
total Faker::Number.number(3)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"uuid": "",
|
|
4
|
-
"message-action": "
|
|
4
|
+
"message-action": "create",
|
|
5
5
|
"subj-id": "",
|
|
6
6
|
"subj": {
|
|
7
7
|
"pid": "",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"license": ""
|
|
17
17
|
}, {
|
|
18
18
|
"uuid": "fc6860b8-4230-41bc-8b8e-21d60e9a7d9a",
|
|
19
|
-
"message-action": "
|
|
19
|
+
"message-action": "create",
|
|
20
20
|
"subj-id": "https://api.test.datacite.org/reports/2018-3-Dashs",
|
|
21
21
|
"subj": {
|
|
22
22
|
"pid": "https://api.test.datacite.org/reports/2018-3-Dashs",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"uuid": "a17e783b-8214-451e-9b0d-077213c2acae",
|
|
4
|
-
"message-action": "
|
|
4
|
+
"message-action": "create",
|
|
5
5
|
"subj-id": "https://api.test.datacite.org/reports/2018-3-Dash",
|
|
6
6
|
"subj": {
|
|
7
7
|
"pid": "https://api.test.datacite.org/reports/2018-3-Dash",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"license": "https://creativecommons.org/publicdomain/zero/1.0/"
|
|
17
17
|
}, {
|
|
18
18
|
"uuid": "fc6860b8-4230-41bc-8b8e-21d60e9a7d9a",
|
|
19
|
-
"message-action": "
|
|
19
|
+
"message-action": "create",
|
|
20
20
|
"subj-id": "https://api.test.datacite.org/reports/2018-3-Dash",
|
|
21
21
|
"subj": {
|
|
22
22
|
"pid": "https://api.test.datacite.org/reports/2018-3-Dash",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"license": "https://creativecommons.org/publicdomain/zero/1.0/"
|
|
32
32
|
}, {
|
|
33
33
|
"uuid": "054da0ad-9821-492e-877e-5c3adbfd5ccf",
|
|
34
|
-
"message-action": "
|
|
34
|
+
"message-action": "create",
|
|
35
35
|
"subj-id": "https://api.test.datacite.org/reports/2018-3-Dash",
|
|
36
36
|
"subj": {
|
|
37
37
|
"pid": "https://api.test.datacite.org/reports/2018-3-Dash",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"license": "https://creativecommons.org/publicdomain/zero/1.0/"
|
|
47
47
|
}, {
|
|
48
48
|
"uuid": "6d6fd620-2123-42da-91f3-6c02e63f3cec",
|
|
49
|
-
"message-action": "
|
|
49
|
+
"message-action": "create",
|
|
50
50
|
"subj-id": "https://api.test.datacite.org/reports/2018-3-Dash",
|
|
51
51
|
"subj": {
|
|
52
52
|
"pid": "https://api.test.datacite.org/reports/2018-3-Dash",
|
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
|
5
5
|
uri: https://api.test.datacite.org/events/fc6860b8-4230-41bc-8b8e-21d60e9a7d9a
|
|
6
6
|
body:
|
|
7
7
|
encoding: UTF-8
|
|
8
|
-
string: '{"data":{"id":"fc6860b8-4230-41bc-8b8e-21d60e9a7d9a","type":"events","attributes":{"uuid":"fc6860b8-4230-41bc-8b8e-21d60e9a7d9a","message-action":"
|
|
8
|
+
string: '{"data":{"id":"fc6860b8-4230-41bc-8b8e-21d60e9a7d9a","type":"events","attributes":{"uuid":"fc6860b8-4230-41bc-8b8e-21d60e9a7d9a","message-action":"create","subj-id":"https://api.test.datacite.org/reports/2018-3-Dashs","subj":{"pid":"https://api.test.datacite.org/reports/2018-3-Dashs","issued":"2128-04-09"},"total":3,"obj-id":"https://doi.org/10.7291/d1q94r","relation-type-id":"unique-dataset-investigations-regular","source-id":"datacite","source-token":"28276d12-b320-41ba-9272-bb0adc3466ff","occurred-at":"2128-04-09","license":"https://creativecommons.org/publicdomain/zero/1.0/"}}}'
|
|
9
9
|
headers:
|
|
10
10
|
User-Agent:
|
|
11
11
|
- Mozilla/5.0 (compatible; Maremma/4.1; +https://github.com/datacite/maremma)
|
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
|
5
5
|
uri: https://api.test.datacite.org/events/a17e783b-8214-451e-9b0d-077213c2acae
|
|
6
6
|
body:
|
|
7
7
|
encoding: UTF-8
|
|
8
|
-
string: '{"data":{"id":"a17e783b-8214-451e-9b0d-077213c2acae","type":"events","attributes":{"uuid":"a17e783b-8214-451e-9b0d-077213c2acae","message-action":"
|
|
8
|
+
string: '{"data":{"id":"a17e783b-8214-451e-9b0d-077213c2acae","type":"events","attributes":{"uuid":"a17e783b-8214-451e-9b0d-077213c2acae","message-action":"create","subj-id":"https://api.test.datacite.org/reports/2018-3-Dash","subj":{"pid":"https://api.test.datacite.org/reports/2018-3-Dash","issued":"2128-04-09"},"total":3,"obj-id":"https://doi.org/10.7291/d1q94r","relation-type-id":"total-dataset-investigations-regular","source-id":"datacite","source-token":"28276d12-b320-41ba-9272-bb0adc3466ff","occurred-at":"2128-04-09","license":"https://creativecommons.org/publicdomain/zero/1.0/"}}}'
|
|
9
9
|
headers:
|
|
10
10
|
User-Agent:
|
|
11
11
|
- Mozilla/5.0 (compatible; Maremma/4.1; +https://github.com/datacite/maremma)
|
|
@@ -171,7 +171,7 @@ http_interactions:
|
|
|
171
171
|
uri: https://api.test.datacite.org/events/fc6860b8-4230-41bc-8b8e-21d60e9a7d9a
|
|
172
172
|
body:
|
|
173
173
|
encoding: UTF-8
|
|
174
|
-
string: '{"data":{"id":"fc6860b8-4230-41bc-8b8e-21d60e9a7d9a","type":"events","attributes":{"uuid":"fc6860b8-4230-41bc-8b8e-21d60e9a7d9a","message-action":"
|
|
174
|
+
string: '{"data":{"id":"fc6860b8-4230-41bc-8b8e-21d60e9a7d9a","type":"events","attributes":{"uuid":"fc6860b8-4230-41bc-8b8e-21d60e9a7d9a","message-action":"create","subj-id":"https://api.test.datacite.org/reports/2018-3-Dash","subj":{"pid":"https://api.test.datacite.org/reports/2018-3-Dash","issued":"2128-04-09"},"total":3,"obj-id":"https://doi.org/10.7291/d1q94r","relation-type-id":"unique-dataset-investigations-regular","source-id":"datacite-usage","source-token":"28276d12-b320-41ba-9272-bb0adc3466ff","occurred-at":"2128-04-09","license":"https://creativecommons.org/publicdomain/zero/1.0/"}}}'
|
|
175
175
|
headers:
|
|
176
176
|
User-Agent:
|
|
177
177
|
- Mozilla/5.0 (compatible; Maremma/4.1; +https://github.com/datacite/maremma)
|
|
@@ -337,7 +337,7 @@ http_interactions:
|
|
|
337
337
|
uri: https://api.test.datacite.org/events/054da0ad-9821-492e-877e-5c3adbfd5ccf
|
|
338
338
|
body:
|
|
339
339
|
encoding: UTF-8
|
|
340
|
-
string: '{"data":{"id":"054da0ad-9821-492e-877e-5c3adbfd5ccf","type":"events","attributes":{"uuid":"054da0ad-9821-492e-877e-5c3adbfd5ccf","message-action":"
|
|
340
|
+
string: '{"data":{"id":"054da0ad-9821-492e-877e-5c3adbfd5ccf","type":"events","attributes":{"uuid":"054da0ad-9821-492e-877e-5c3adbfd5ccf","message-action":"create","subj-id":"https://api.test.datacite.org/reports/2018-3-Dash","subj":{"pid":"https://api.test.datacite.org/reports/2018-3-Dash","issued":"2128-04-09"},"total":254,"obj-id":"https://doi.org/10.6071/z7wc73","relation-type-id":"Total-Dataset-Requests-Machine","source-id":"datacite-usage","source-token":"28276d12-b320-41ba-9272-bb0adc3466ff","occurred-at":"2128-04-09","license":"https://creativecommons.org/publicdomain/zero/1.0/"}}}'
|
|
341
341
|
headers:
|
|
342
342
|
User-Agent:
|
|
343
343
|
- Mozilla/5.0 (compatible; Maremma/4.1; +https://github.com/datacite/maremma)
|
|
@@ -503,7 +503,7 @@ http_interactions:
|
|
|
503
503
|
uri: https://api.test.datacite.org/events/6d6fd620-2123-42da-91f3-6c02e63f3cec
|
|
504
504
|
body:
|
|
505
505
|
encoding: UTF-8
|
|
506
|
-
string: '{"data":{"id":"6d6fd620-2123-42da-91f3-6c02e63f3cec","type":"events","attributes":{"uuid":"6d6fd620-2123-42da-91f3-6c02e63f3cec","message-action":"
|
|
506
|
+
string: '{"data":{"id":"6d6fd620-2123-42da-91f3-6c02e63f3cec","type":"events","attributes":{"uuid":"6d6fd620-2123-42da-91f3-6c02e63f3cec","message-action":"create","subj-id":"https://api.test.datacite.org/reports/2018-3-Dash","subj":{"pid":"https://api.test.datacite.org/reports/2018-3-Dash","issued":"2128-04-09"},"total":208,"obj-id":"https://doi.org/10.6071/z7wc73","relation-type-id":"Unique-Dataset-Requests-Machine","source-id":"datacite-usage","source-token":"28276d12-b320-41ba-9272-bb0adc3466ff","occurred-at":"2128-04-09","license":"https://creativecommons.org/publicdomain/zero/1.0/"}}}'
|
|
507
507
|
headers:
|
|
508
508
|
User-Agent:
|
|
509
509
|
- Mozilla/5.0 (compatible; Maremma/4.1; +https://github.com/datacite/maremma)
|
data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_work_with_a_single_item.yml
CHANGED
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
|
5
5
|
uri: https://api.test.datacite.org/events/a17e783b-8214-451e-9b0d-077213c2acae
|
|
6
6
|
body:
|
|
7
7
|
encoding: UTF-8
|
|
8
|
-
string: '{"data":{"id":"a17e783b-8214-451e-9b0d-077213c2acae","type":"events","attributes":{"uuid":"a17e783b-8214-451e-9b0d-077213c2acae","message-action":"
|
|
8
|
+
string: '{"data":{"id":"a17e783b-8214-451e-9b0d-077213c2acae","type":"events","attributes":{"uuid":"a17e783b-8214-451e-9b0d-077213c2acae","message-action":"create","subj-id":"https://api.test.datacite.org/reports/2018-3-Dash","subj":{"pid":"https://api.test.datacite.org/reports/2018-3-Dash","issued":"2128-04-09"},"total":3,"obj-id":"https://doi.org/10.7291/d1q94r","relation-type-id":"total-dataset-investigations-regular","source-id":"datacite","source-token":"28276d12-b320-41ba-9272-bb0adc3466ff","occurred-at":"2128-04-09","license":"https://creativecommons.org/publicdomain/zero/1.0/"}}}'
|
|
9
9
|
headers:
|
|
10
10
|
User-Agent:
|
|
11
11
|
- Mozilla/5.0 (compatible; Maremma/4.1; +https://github.com/datacite/maremma)
|
data/spec/usage_update_spec.rb
CHANGED
|
@@ -76,7 +76,7 @@ describe Toccatore::UsageUpdate, vcr: true do
|
|
|
76
76
|
result = OpenStruct.new(body: JSON.parse(body), url:"https://api.test.datacite.org/reports/5cac6ca0-9391-4e1d-95cf-ba2f475cbfad" )
|
|
77
77
|
response = subject.parse_data(result, source_token: ENV['SOURCE_TOKEN'])
|
|
78
78
|
expect(response.length).to eq(2)
|
|
79
|
-
expect(response.last.except("uuid")).to eq("subj"=>{"pid"=>"https://api.test.datacite.org/reports/5cac6ca0-9391-4e1d-95cf-ba2f475cbfad", "issued"=>"2128-04-09"},"total"=>3,"message-action" => "
|
|
79
|
+
expect(response.last.except("uuid")).to eq("subj"=>{"pid"=>"https://api.test.datacite.org/reports/5cac6ca0-9391-4e1d-95cf-ba2f475cbfad", "issued"=>"2128-04-09"},"total"=>3,"message-action" => "create", "subj-id"=>"https://api.test.datacite.org/reports/5cac6ca0-9391-4e1d-95cf-ba2f475cbfad", "obj-id"=>"https://doi.org/10.7291/d1q94r", "relation-type-id"=>"unique-dataset-investigations-regular", "source-id"=>"datacite-usage", "occurred-at"=>"2128-04-09", "license" => "https://creativecommons.org/publicdomain/zero/1.0/", "source-token" => ENV['SOURCE_TOKEN'])
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
it "should parsed it correctly when it has five metrics and two DOIs" do
|
|
@@ -84,7 +84,7 @@ describe Toccatore::UsageUpdate, vcr: true do
|
|
|
84
84
|
result = OpenStruct.new(body: JSON.parse(body), url:"https://api.test.datacite.org/reports/5cac6ca0-9391-4e1d-95cf-ba2f475cbfad" )
|
|
85
85
|
response = subject.parse_data(result, source_token: ENV['SOURCE_TOKEN'])
|
|
86
86
|
expect(response.length).to eq(5)
|
|
87
|
-
expect(response.last.except("uuid")).to eq("message-action"=>"
|
|
87
|
+
expect(response.last.except("uuid")).to eq("message-action"=>"create", "subj-id"=>"https://api.test.datacite.org/reports/5cac6ca0-9391-4e1d-95cf-ba2f475cbfad", "subj"=>{"pid"=>"https://api.test.datacite.org/reports/5cac6ca0-9391-4e1d-95cf-ba2f475cbfad", "issued"=>"2128-04-09"}, "total"=>208, "obj-id"=>"https://doi.org/10.6071/z7wc73", "relation-type-id"=>"Unique-Dataset-Requests-Machine", "source-id"=>"datacite-usage", "source-token"=>ENV['SOURCE_TOKEN'], "occurred-at"=>"2128-04-09", "license"=>"https://creativecommons.org/publicdomain/zero/1.0/")
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
it "should parsed it correctly when it has two metrics per DOI " do
|
|
@@ -92,7 +92,7 @@ describe Toccatore::UsageUpdate, vcr: true do
|
|
|
92
92
|
result = OpenStruct.new(body: JSON.parse(body), url:"https://api.test.datacite.org/reports/5cac6ca0-9391-4e1d-95cf-ba2f475cbfad")
|
|
93
93
|
response = subject.parse_data(result, source_token: ENV['SOURCE_TOKEN'])
|
|
94
94
|
expect(response.length).to eq(4)
|
|
95
|
-
expect(response.last.except("uuid")).to eq("message-action"=>"
|
|
95
|
+
expect(response.last.except("uuid")).to eq("message-action"=>"create", "subj-id"=>"https://api.test.datacite.org/reports/5cac6ca0-9391-4e1d-95cf-ba2f475cbfad", "subj"=>{"pid"=>"https://api.test.datacite.org/reports/5cac6ca0-9391-4e1d-95cf-ba2f475cbfad", "issued"=>"2128-04-09"}, "total"=>208, "obj-id"=>"https://doi.org/10.6071/z7wc73", "relation-type-id"=>"Unique-Dataset-Requests-Machine", "source-id"=>"datacite-usage", "source-token"=>ENV['SOURCE_TOKEN'], "occurred-at"=>"2128-04-09", "license"=>"https://creativecommons.org/publicdomain/zero/1.0/")
|
|
96
96
|
end
|
|
97
97
|
|
|
98
98
|
it "should send a warning if there are more than 4 metrics" do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: toccatore
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Martin Fenner
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-08-
|
|
11
|
+
date: 2018-08-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: maremma
|