toccatore 0.3.9 → 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 +5 -5
- data/Gemfile.lock +76 -54
- data/README.md +1 -1
- data/lib/toccatore/base.rb +15 -4
- data/lib/toccatore/cli.rb +12 -0
- data/lib/toccatore/datacite_related.rb +18 -3
- data/lib/toccatore/orcid_update.rb +6 -2
- data/lib/toccatore/queue.rb +56 -0
- data/lib/toccatore/usage_update.rb +183 -0
- data/lib/toccatore/version.rb +1 -1
- data/lib/toccatore.rb +2 -0
- data/spec/base_spec.rb +4 -4
- data/spec/cli_spec.rb +36 -3
- data/spec/datacite_related_spec.rb +10 -10
- data/spec/factories/default.rb +22 -0
- data/spec/fixtures/event_data_resp_1 +2 -0
- data/spec/fixtures/event_data_resp_2 +4 -0
- data/spec/fixtures/events_empty.json +33 -0
- data/spec/fixtures/usage_event.json +1 -0
- data/spec/fixtures/usage_event_fail.json +17 -0
- data/spec/fixtures/usage_events.json +63 -0
- data/spec/fixtures/usage_update.json +101 -0
- data/spec/fixtures/usage_update_1.json +36738 -0
- data/spec/fixtures/usage_update_2.json +171 -0
- data/spec/fixtures/usage_update_3.json +176 -0
- data/spec/fixtures/usage_update_4.json +101 -0
- data/spec/fixtures/usage_update_nil.json +6 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_Base/get_doi_ra/crossref.yml +21 -45
- data/spec/fixtures/vcr_cassettes/Toccatore_Base/get_doi_ra/datacite.yml +23 -47
- data/spec/fixtures/vcr_cassettes/Toccatore_Base/send_notification_to_slack/datacite_related.yml +14 -12
- data/spec/fixtures/vcr_cassettes/Toccatore_Base/send_notification_to_slack/datacite_related_no_works.yml +15 -13
- data/spec/fixtures/vcr_cassettes/Toccatore_Base/send_notification_to_slack/orcid_update.yml +14 -12
- data/spec/fixtures/vcr_cassettes/Toccatore_Base/send_notification_to_slack/orcid_update_no_works.yml +15 -13
- data/spec/fixtures/vcr_cassettes/Toccatore_CLI/datacite_related/should_fail.yml +345 -852
- data/spec/fixtures/vcr_cassettes/Toccatore_CLI/datacite_related/should_query_by_DOI.yml +327 -409
- data/spec/fixtures/vcr_cassettes/Toccatore_CLI/datacite_related/should_query_by_related_identifier.yml +140 -117
- data/spec/fixtures/vcr_cassettes/Toccatore_CLI/datacite_related/should_succeed.yml +1267 -2068
- data/spec/fixtures/vcr_cassettes/Toccatore_CLI/datacite_related/should_succeed_with_no_works.yml +31 -25
- data/spec/fixtures/vcr_cassettes/Toccatore_CLI/orcid_update/should_fail.yml +47 -39
- data/spec/fixtures/vcr_cassettes/Toccatore_CLI/orcid_update/should_query_by_DOI.yml +673 -855
- data/spec/fixtures/vcr_cassettes/Toccatore_CLI/orcid_update/should_query_by_ORCID_ID.yml +1885 -2419
- data/spec/fixtures/vcr_cassettes/Toccatore_CLI/orcid_update/should_succeed.yml +1555 -1991
- data/spec/fixtures/vcr_cassettes/Toccatore_CLI/orcid_update/should_succeed_with_no_works.yml +31 -27
- data/spec/fixtures/vcr_cassettes/Toccatore_CLI/usage_update/no_reports_in_the_queue/should_succeed_with_no_works.yml +196 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_DataciteRelated/get_data/should_allow_queries_by_DOI_of_the_Datacite_Metadata_Search_API.yml +16 -12
- data/spec/fixtures/vcr_cassettes/Toccatore_DataciteRelated/get_data/should_allow_queries_by_related_identifier_of_the_Datacite_Metadata_Search_API.yml +17 -13
- data/spec/fixtures/vcr_cassettes/Toccatore_DataciteRelated/get_data/should_report_if_there_are_no_works_returned_by_the_Datacite_Metadata_Search_API.yml +16 -12
- data/spec/fixtures/vcr_cassettes/Toccatore_DataciteRelated/get_data/should_report_if_there_are_works_returned_by_the_Datacite_Metadata_Search_API.yml +16 -14
- data/spec/fixtures/vcr_cassettes/Toccatore_DataciteRelated/get_total/with_no_works.yml +15 -11
- data/spec/fixtures/vcr_cassettes/Toccatore_DataciteRelated/get_total/with_works.yml +16 -12
- data/spec/fixtures/vcr_cassettes/Toccatore_DataciteRelated/parse_data/should_report_if_there_are_works_returned_by_the_Datacite_Metadata_Search_API.yml +437 -869
- data/spec/fixtures/vcr_cassettes/Toccatore_DataciteRelated/push_data/should_report_if_there_are_works_returned_by_the_Datacite_Metadata_Search_API.yml +1240 -1662
- data/spec/fixtures/vcr_cassettes/Toccatore_DataciteRelated/push_data/should_work_with_DataCite_Event_Data.yml +4026 -6556
- data/spec/fixtures/vcr_cassettes/Toccatore_OrcidUpdate/get_data/should_allow_queries_by_DOI_of_the_Datacite_Metadata_Search_API.yml +15 -13
- data/spec/fixtures/vcr_cassettes/Toccatore_OrcidUpdate/get_data/should_allow_queries_by_ORCID_ID_of_the_Datacite_Metadata_Search_API.yml +15 -11
- data/spec/fixtures/vcr_cassettes/Toccatore_OrcidUpdate/get_data/should_report_if_there_are_no_works_returned_by_the_Datacite_Metadata_Search_API.yml +15 -11
- data/spec/fixtures/vcr_cassettes/Toccatore_OrcidUpdate/get_data/should_report_if_there_are_works_returned_by_the_Datacite_Metadata_Search_API.yml +15 -13
- data/spec/fixtures/vcr_cassettes/Toccatore_OrcidUpdate/get_total/with_no_works.yml +15 -13
- data/spec/fixtures/vcr_cassettes/Toccatore_OrcidUpdate/get_total/with_works.yml +15 -13
- data/spec/fixtures/vcr_cassettes/Toccatore_OrcidUpdate/push_data/should_delete_claims.yml +25 -32
- data/spec/fixtures/vcr_cassettes/Toccatore_OrcidUpdate/push_data/should_report_if_there_are_works_returned_by_the_Datacite_Metadata_Search_API.yml +1347 -1791
- data/spec/fixtures/vcr_cassettes/Toccatore_OrcidUpdate/queue_jobs/should_report_if_there_are_no_works_returned_by_the_Datacite_Metadata_Search_API.yml +14 -10
- data/spec/fixtures/vcr_cassettes/Toccatore_OrcidUpdate/queue_jobs/should_report_if_there_are_works_returned_by_the_Datacite_Metadata_Search_API.yml +29 -25
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_data/when_there_are_messages/should_return_the_data_for_one_message.yml +73 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_data/when_there_is_ONE_message/should_return_the_data_for_one_message.yml +73 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_message/should_return_no_meessage_when_the_queue_is_empty.yml +95 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_message/should_return_one_message_when_there_are_multiple_messages.yml +95 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_total/when_is_working_with_AWS.yml +187 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_fail_if_format_of_the_event_is_empty.yml +169 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_fail_if_format_of_the_event_is_wrong.yml +667 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_work_with_a_single_item.yml +169 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/queue_url/should_return_always_correct_queue_url.yml +49 -0
- data/spec/orcid_update_spec.rb +1 -1
- data/spec/queue_spec.rb +47 -0
- data/spec/spec_helper.rb +23 -1
- data/spec/usage_update_spec.rb +146 -0
- data/toccatore.gemspec +11 -5
- metadata +109 -26
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
|
5
5
|
uri: "<SLACK_WEBHOOK_URL>"
|
|
6
6
|
body:
|
|
7
7
|
encoding: US-ASCII
|
|
8
|
-
string: payload=%7B%22username%22%3A%22Event+Data+Agent%22%2C%22icon_url%22%3A%22https%3A%2F%2Fraw.githubusercontent.com%2Fdatacite%2Ftoccatore%2Fmaster%2Flib%2Ftoccatore%2Fimages%2Ftoccatore.png%22%2C%22attachments%22%3A%5B%7B%22title%22%3A%22Report+for+datacite_related%22%2C%22text%22%3A%
|
|
8
|
+
string: payload=%7B%22username%22%3A%22Event+Data+Agent%22%2C%22icon_url%22%3A%22https%3A%2F%2Fraw.githubusercontent.com%2Fdatacite%2Ftoccatore%2Fmaster%2Flib%2Ftoccatore%2Fimages%2Ftoccatore.png%22%2C%22attachments%22%3A%5B%7B%22title%22%3A%22Report+for+datacite_related%22%2C%22text%22%3A%22No+works+found+for+date+range+2015-04-07+-+2015-04-08.%22%2C%22color%22%3A%22warning%22%7D%5D%7D
|
|
9
9
|
headers:
|
|
10
10
|
Accept-Encoding:
|
|
11
11
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
@@ -26,31 +26,33 @@ http_interactions:
|
|
|
26
26
|
- '22'
|
|
27
27
|
Connection:
|
|
28
28
|
- keep-alive
|
|
29
|
-
Access-Control-Allow-Origin:
|
|
30
|
-
- "*"
|
|
31
29
|
Date:
|
|
32
|
-
-
|
|
33
|
-
Referrer-Policy:
|
|
34
|
-
- no-referrer
|
|
30
|
+
- Fri, 10 Aug 2018 16:22:55 GMT
|
|
35
31
|
Server:
|
|
36
32
|
- Apache
|
|
33
|
+
X-Slack-Backend:
|
|
34
|
+
- h
|
|
35
|
+
Referrer-Policy:
|
|
36
|
+
- no-referrer
|
|
37
37
|
Strict-Transport-Security:
|
|
38
38
|
- max-age=31536000; includeSubDomains; preload
|
|
39
|
-
Vary:
|
|
40
|
-
- Accept-Encoding
|
|
41
39
|
X-Frame-Options:
|
|
42
40
|
- SAMEORIGIN
|
|
43
|
-
|
|
44
|
-
-
|
|
41
|
+
Vary:
|
|
42
|
+
- Accept-Encoding
|
|
43
|
+
Access-Control-Allow-Origin:
|
|
44
|
+
- "*"
|
|
45
|
+
X-Via:
|
|
46
|
+
- haproxy-www-1dak
|
|
45
47
|
X-Cache:
|
|
46
48
|
- Miss from cloudfront
|
|
47
49
|
Via:
|
|
48
|
-
- 1.1
|
|
50
|
+
- 1.1 8391f131e4acb30724947dab1f8592a5.cloudfront.net (CloudFront)
|
|
49
51
|
X-Amz-Cf-Id:
|
|
50
|
-
-
|
|
52
|
+
- yA55f36SX2NU10nM60AG-sukjhRiMrkcE7XYzKhWkfkspwTo9-JAHw==
|
|
51
53
|
body:
|
|
52
54
|
encoding: ASCII-8BIT
|
|
53
55
|
string: ok
|
|
54
56
|
http_version:
|
|
55
|
-
recorded_at:
|
|
57
|
+
recorded_at: Fri, 10 Aug 2018 16:22:55 GMT
|
|
56
58
|
recorded_with: VCR 3.0.3
|
|
@@ -26,31 +26,33 @@ http_interactions:
|
|
|
26
26
|
- '22'
|
|
27
27
|
Connection:
|
|
28
28
|
- keep-alive
|
|
29
|
-
Access-Control-Allow-Origin:
|
|
30
|
-
- "*"
|
|
31
29
|
Date:
|
|
32
|
-
-
|
|
33
|
-
Referrer-Policy:
|
|
34
|
-
- no-referrer
|
|
30
|
+
- Fri, 10 Aug 2018 16:22:55 GMT
|
|
35
31
|
Server:
|
|
36
32
|
- Apache
|
|
33
|
+
X-Slack-Backend:
|
|
34
|
+
- h
|
|
35
|
+
Referrer-Policy:
|
|
36
|
+
- no-referrer
|
|
37
37
|
Strict-Transport-Security:
|
|
38
38
|
- max-age=31536000; includeSubDomains; preload
|
|
39
|
-
Vary:
|
|
40
|
-
- Accept-Encoding
|
|
41
39
|
X-Frame-Options:
|
|
42
40
|
- SAMEORIGIN
|
|
43
|
-
|
|
44
|
-
-
|
|
41
|
+
Vary:
|
|
42
|
+
- Accept-Encoding
|
|
43
|
+
Access-Control-Allow-Origin:
|
|
44
|
+
- "*"
|
|
45
|
+
X-Via:
|
|
46
|
+
- haproxy-www-egoz
|
|
45
47
|
X-Cache:
|
|
46
48
|
- Miss from cloudfront
|
|
47
49
|
Via:
|
|
48
|
-
- 1.1
|
|
50
|
+
- 1.1 5954578e851092964f39f2f5f0596950.cloudfront.net (CloudFront)
|
|
49
51
|
X-Amz-Cf-Id:
|
|
50
|
-
-
|
|
52
|
+
- gaF12DJ6cemBuBReC2E4UVsBD1vITQqkohD7fo8xysh7Ckx5dILaxg==
|
|
51
53
|
body:
|
|
52
54
|
encoding: ASCII-8BIT
|
|
53
55
|
string: ok
|
|
54
56
|
http_version:
|
|
55
|
-
recorded_at:
|
|
57
|
+
recorded_at: Fri, 10 Aug 2018 16:22:55 GMT
|
|
56
58
|
recorded_with: VCR 3.0.3
|
data/spec/fixtures/vcr_cassettes/Toccatore_Base/send_notification_to_slack/orcid_update_no_works.yml
CHANGED
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
|
5
5
|
uri: "<SLACK_WEBHOOK_URL>"
|
|
6
6
|
body:
|
|
7
7
|
encoding: US-ASCII
|
|
8
|
-
string: payload=%7B%22username%22%3A%22Event+Data+Agent%22%2C%22icon_url%22%3A%22https%3A%2F%2Fraw.githubusercontent.com%2Fdatacite%2Ftoccatore%2Fmaster%2Flib%2Ftoccatore%2Fimages%2Ftoccatore.png%22%2C%22attachments%22%3A%5B%7B%22title%22%3A%22Report+for+orcid_update%22%2C%22text%22%3A%
|
|
8
|
+
string: payload=%7B%22username%22%3A%22Event+Data+Agent%22%2C%22icon_url%22%3A%22https%3A%2F%2Fraw.githubusercontent.com%2Fdatacite%2Ftoccatore%2Fmaster%2Flib%2Ftoccatore%2Fimages%2Ftoccatore.png%22%2C%22attachments%22%3A%5B%7B%22title%22%3A%22Report+for+orcid_update%22%2C%22text%22%3A%22No+works+found+for+date+range+2015-04-07+-+2015-04-08.%22%2C%22color%22%3A%22warning%22%7D%5D%7D
|
|
9
9
|
headers:
|
|
10
10
|
Accept-Encoding:
|
|
11
11
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
@@ -26,31 +26,33 @@ http_interactions:
|
|
|
26
26
|
- '22'
|
|
27
27
|
Connection:
|
|
28
28
|
- keep-alive
|
|
29
|
-
Access-Control-Allow-Origin:
|
|
30
|
-
- "*"
|
|
31
29
|
Date:
|
|
32
|
-
-
|
|
33
|
-
Referrer-Policy:
|
|
34
|
-
- no-referrer
|
|
30
|
+
- Fri, 10 Aug 2018 16:22:55 GMT
|
|
35
31
|
Server:
|
|
36
32
|
- Apache
|
|
33
|
+
X-Slack-Backend:
|
|
34
|
+
- h
|
|
35
|
+
Referrer-Policy:
|
|
36
|
+
- no-referrer
|
|
37
37
|
Strict-Transport-Security:
|
|
38
38
|
- max-age=31536000; includeSubDomains; preload
|
|
39
|
-
Vary:
|
|
40
|
-
- Accept-Encoding
|
|
41
39
|
X-Frame-Options:
|
|
42
40
|
- SAMEORIGIN
|
|
43
|
-
|
|
44
|
-
-
|
|
41
|
+
Vary:
|
|
42
|
+
- Accept-Encoding
|
|
43
|
+
Access-Control-Allow-Origin:
|
|
44
|
+
- "*"
|
|
45
|
+
X-Via:
|
|
46
|
+
- haproxy-www-gqq9
|
|
45
47
|
X-Cache:
|
|
46
48
|
- Miss from cloudfront
|
|
47
49
|
Via:
|
|
48
|
-
- 1.1
|
|
50
|
+
- 1.1 e72ed739d85b0c5633dfd1f214a1adca.cloudfront.net (CloudFront)
|
|
49
51
|
X-Amz-Cf-Id:
|
|
50
|
-
-
|
|
52
|
+
- vEtVeIti62chzJq_sHG7P_fHVny7c9nQNC9RckvHM3Vfr5YST6Hulg==
|
|
51
53
|
body:
|
|
52
54
|
encoding: ASCII-8BIT
|
|
53
55
|
string: ok
|
|
54
56
|
http_version:
|
|
55
|
-
recorded_at:
|
|
57
|
+
recorded_at: Fri, 10 Aug 2018 16:22:55 GMT
|
|
56
58
|
recorded_with: VCR 3.0.3
|