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
|
@@ -8,28 +8,32 @@ http_interactions:
|
|
|
8
8
|
string: ''
|
|
9
9
|
headers:
|
|
10
10
|
User-Agent:
|
|
11
|
-
- Maremma
|
|
11
|
+
- Mozilla/5.0 (compatible; Maremma/4.1; +https://github.com/datacite/maremma)
|
|
12
12
|
Accept:
|
|
13
13
|
- text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
|
|
14
14
|
response:
|
|
15
15
|
status:
|
|
16
16
|
code: 200
|
|
17
|
-
message:
|
|
17
|
+
message: OK
|
|
18
18
|
headers:
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
Access-Control-Allow-Origin:
|
|
22
|
-
- "*"
|
|
19
|
+
Date:
|
|
20
|
+
- Fri, 10 Aug 2018 17:33:04 GMT
|
|
23
21
|
Content-Type:
|
|
24
22
|
- application/json;charset=UTF-8
|
|
25
|
-
Date:
|
|
26
|
-
- Sat, 11 Mar 2017 08:27:49 GMT
|
|
27
|
-
Server:
|
|
28
|
-
- openresty/1.11.2.2
|
|
29
23
|
Connection:
|
|
30
24
|
- keep-alive
|
|
25
|
+
Server:
|
|
26
|
+
- nginx/1.10.3 (Ubuntu)
|
|
27
|
+
Access-Control-Allow-Origin:
|
|
28
|
+
- "*"
|
|
29
|
+
Access-Control-Allow-Methods:
|
|
30
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
|
31
|
+
Access-Control-Allow-Headers:
|
|
32
|
+
- DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,Authorization
|
|
33
|
+
Access-Control-Expose-Headers:
|
|
34
|
+
- DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,Authorization
|
|
31
35
|
body:
|
|
32
|
-
encoding:
|
|
36
|
+
encoding: ASCII-8BIT
|
|
33
37
|
string: '{"responseHeader":{"status":0,"QTime":0},"response":{"numFound":0,"start":0,"docs":[]}}
|
|
34
38
|
|
|
35
39
|
'
|
|
@@ -8,29 +8,33 @@ http_interactions:
|
|
|
8
8
|
string: ''
|
|
9
9
|
headers:
|
|
10
10
|
User-Agent:
|
|
11
|
-
- Maremma
|
|
11
|
+
- Mozilla/5.0 (compatible; Maremma/4.1; +https://github.com/datacite/maremma)
|
|
12
12
|
Accept:
|
|
13
13
|
- text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
|
|
14
14
|
response:
|
|
15
15
|
status:
|
|
16
16
|
code: 200
|
|
17
|
-
message:
|
|
17
|
+
message: OK
|
|
18
18
|
headers:
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
Access-Control-Allow-Origin:
|
|
22
|
-
- "*"
|
|
19
|
+
Date:
|
|
20
|
+
- Fri, 10 Aug 2018 17:33:04 GMT
|
|
23
21
|
Content-Type:
|
|
24
22
|
- application/json;charset=UTF-8
|
|
25
|
-
Date:
|
|
26
|
-
- Sat, 11 Mar 2017 08:27:50 GMT
|
|
27
|
-
Server:
|
|
28
|
-
- openresty/1.11.2.2
|
|
29
23
|
Connection:
|
|
30
24
|
- keep-alive
|
|
25
|
+
Server:
|
|
26
|
+
- nginx/1.10.3 (Ubuntu)
|
|
27
|
+
Access-Control-Allow-Origin:
|
|
28
|
+
- "*"
|
|
29
|
+
Access-Control-Allow-Methods:
|
|
30
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
|
31
|
+
Access-Control-Allow-Headers:
|
|
32
|
+
- DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,Authorization
|
|
33
|
+
Access-Control-Expose-Headers:
|
|
34
|
+
- DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,Authorization
|
|
31
35
|
body:
|
|
32
|
-
encoding:
|
|
33
|
-
string: '{"responseHeader":{"status":0,"QTime":
|
|
36
|
+
encoding: ASCII-8BIT
|
|
37
|
+
string: '{"responseHeader":{"status":0,"QTime":699},"response":{"numFound":640,"start":0,"docs":[]}}
|
|
34
38
|
|
|
35
39
|
'
|
|
36
40
|
http_version:
|