cirneco 0.9.12 → 0.9.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +124 -49
  3. data/cirneco.gemspec +5 -4
  4. data/lib/cirneco/api.rb +8 -8
  5. data/lib/cirneco/base.rb +2 -2
  6. data/lib/cirneco/cli.rb +1 -1
  7. data/lib/cirneco/utils.rb +48 -95
  8. data/lib/cirneco/version.rb +1 -1
  9. data/lib/cirneco/work.rb +8 -203
  10. data/spec/api_spec.rb +16 -28
  11. data/spec/doi_spec.rb +9 -11
  12. data/spec/fixtures/cool-dois-minted/index.html +189 -234
  13. data/spec/fixtures/cool-dois-minted.html.md +1 -1
  14. data/spec/fixtures/cool-dois.html.md +2 -2
  15. data/spec/fixtures/index-minted.html +1 -1
  16. data/spec/fixtures/index.html +50 -1
  17. data/spec/fixtures/index.html.erb +2 -2
  18. data/spec/fixtures/vcr_cassettes/Cirneco_DataCenter/get/should_get_all_dois_by_prefix.yml +20 -18
  19. data/spec/fixtures/vcr_cassettes/Cirneco_DataCenter/jats/should_generate_jats_for_all_urls.yml +38 -0
  20. data/spec/fixtures/vcr_cassettes/Cirneco_DataCenter/mint_and_hide_DOIs/should_hide_for_all_urls.yml +20 -20
  21. data/spec/fixtures/vcr_cassettes/Cirneco_DataCenter/mint_and_hide_DOIs/should_hide_for_url.yml +19 -17
  22. data/spec/fixtures/vcr_cassettes/Cirneco_DataCenter/mint_and_hide_DOIs/should_hide_metadata_for_work.yml +19 -17
  23. data/spec/fixtures/vcr_cassettes/Cirneco_DataCenter/mint_and_hide_DOIs/should_mint_and_hide_for_all_urls.yml +204 -108
  24. data/spec/fixtures/vcr_cassettes/Cirneco_DataCenter/mint_and_hide_DOIs/should_mint_and_hide_for_url.yml +72 -64
  25. data/spec/fixtures/vcr_cassettes/Cirneco_DataCenter/mint_and_hide_DOIs/should_mint_for_all_urls.yml +17 -291
  26. data/spec/fixtures/vcr_cassettes/Cirneco_DataCenter/mint_and_hide_DOIs/should_post_metadata_for_work.yml +47 -82
  27. data/spec/fixtures/vcr_cassettes/Cirneco_Doi/MDS_DOI_API/get/should_get_all_dois.yml +22 -18
  28. data/spec/fixtures/vcr_cassettes/Cirneco_Doi/MDS_DOI_API/get/should_get_doi.yml +19 -17
  29. data/spec/fixtures/vcr_cassettes/Cirneco_Doi/MDS_DOI_API/put/should_put_doi.yml +20 -18
  30. data/spec/fixtures/vcr_cassettes/Cirneco_Doi/jats/writes_jats_for_list_of_urls.yml +38 -0
  31. data/spec/fixtures/vcr_cassettes/Cirneco_Doi/mint_and_hide_DOIs/hides_a_doi.yml +19 -17
  32. data/spec/fixtures/vcr_cassettes/Cirneco_Doi/mint_and_hide_DOIs/hides_dois_for_list_of_urls.yml +81 -0
  33. data/spec/fixtures/vcr_cassettes/Cirneco_Doi/mint_and_hide_DOIs/mints_and_hides_a_doi.yml +72 -64
  34. data/spec/fixtures/vcr_cassettes/Cirneco_Doi/mint_and_hide_DOIs/mints_and_hides_dois_for_list_of_urls.yml +204 -108
  35. data/spec/fixtures/vcr_cassettes/Cirneco_Doi/mint_and_hide_DOIs/mints_dois_for_list_of_urls.yml +17 -291
  36. data/spec/fixtures/vcr_cassettes/Cirneco_Work/DOI_API/get/should_get_all_dois.yml +140 -18
  37. data/spec/fixtures/vcr_cassettes/Cirneco_Work/DOI_API/get/should_get_doi.yml +137 -17
  38. data/spec/fixtures/vcr_cassettes/Cirneco_Work/DOI_API/get/should_get_doi_not_found.yml +134 -16
  39. data/spec/fixtures/vcr_cassettes/Cirneco_Work/DOI_API/get/username_missing.yml +121 -0
  40. data/spec/fixtures/vcr_cassettes/Cirneco_Work/DOI_API/put/should_put_doi.yml +138 -18
  41. data/spec/fixtures/vcr_cassettes/Cirneco_Work/Media_API/get/should_get_media.yml +135 -17
  42. data/spec/fixtures/vcr_cassettes/Cirneco_Work/Media_API/post/should_post_media.yml +137 -17
  43. data/spec/fixtures/vcr_cassettes/Cirneco_Work/Metadata_API/delete/should_delete_metadata.yml +137 -17
  44. data/spec/fixtures/vcr_cassettes/Cirneco_Work/Metadata_API/get/should_get_metadata.yml +170 -27
  45. data/spec/fixtures/vcr_cassettes/Cirneco_Work/Metadata_API/post/should_post_metadata.yml +173 -28
  46. data/spec/fixtures/vcr_cassettes/Cirneco_Work/media/includes_media.yml +121 -0
  47. data/spec/fixtures/vcr_cassettes/Cirneco_Work/schema/BlogPosting.yml +121 -0
  48. data/spec/spec_helper.rb +1 -1
  49. data/spec/utils_spec.rb +28 -41
  50. data/spec/work_spec.rb +33 -43
  51. metadata +43 -19
  52. data/spec/fixtures/vcr_cassettes/Cirneco_DataCenter/mint_and_hide_DOIs/should_mint_for_url.yml +0 -174
  53. data/spec/fixtures/vcr_cassettes/Cirneco_Doi/mint_and_hide_DOIs/mints_a_doi.yml +0 -174
@@ -1,174 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://mds-sandbox.datacite.org/metadata
6
- body:
7
- encoding: UTF-8
8
- string: |
9
- <?xml version="1.0" encoding="UTF-8"?>
10
- <resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4/metadata.xsd">
11
- <identifier identifierType="DOI">10.5072/0000-03VC</identifier>
12
- <creators>
13
- <creator>
14
- <creatorName>Fenner, Martin</creatorName>
15
- <givenName>Martin</givenName>
16
- <familyName>Fenner</familyName>
17
- <nameIdentifier schemeURI="http://orcid.org/" nameIdentifierScheme="ORCID">0000-0003-1419-2405</nameIdentifier>
18
- </creator>
19
- </creators>
20
- <titles>
21
- <title>Cool DOI's</title>
22
- </titles>
23
- <publisher>DataCite</publisher>
24
- <publicationYear>2016</publicationYear>
25
- <resourceType resourceTypeGeneral="Text">BlogPosting</resourceType>
26
- <alternateIdentifiers>
27
- <alternateIdentifier alternateIdentifierType="Local accession number">MS-123</alternateIdentifier>
28
- </alternateIdentifiers>
29
- <subjects>
30
- <subject>doi</subject>
31
- </subjects>
32
- <dates>
33
- <date dateType="Created">2016-12-15</date>
34
- <date dateType="Issued">2016-12-15</date>
35
- <date dateType="Updated">2016-12-15</date>
36
- </dates>
37
- <relatedIdentifiers>
38
- <relatedIdentifier relatedIdentifierType="URL" relationType="References">https://www.w3.org/Provider/Style/URI</relatedIdentifier>
39
- <relatedIdentifier relatedIdentifierType="DOI" relationType="References">10.1371/JOURNAL.PONE.0115253</relatedIdentifier>
40
- <relatedIdentifier relatedIdentifierType="URL" relationType="IsPartOf">https://blog.datacite.org/</relatedIdentifier>
41
- </relatedIdentifiers>
42
- <version>1.0</version>
43
- <descriptions>
44
- <description descriptionType="Abstract">In 1998 Tim Berners-Lee coined the term cool URIs (1998), that is URIs that don’t change. We know that URLs referenced in the scholarly literature are often not cool, leading to link rot (Klein et al., 2014) and making it hard or impossible to find...</description>
45
- </descriptions>
46
- </resource>
47
- headers:
48
- User-Agent:
49
- - Maremma - https://github.com/datacite/maremma
50
- Content-Type:
51
- - application/xml;charset=UTF-8
52
- Accept:
53
- - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
54
- Authorization:
55
- - Basic <MDS_TOKEN>
56
- response:
57
- status:
58
- code: 201
59
- message: ''
60
- headers:
61
- Server:
62
- - openresty/1.11.2.1
63
- Date:
64
- - Mon, 02 Jan 2017 21:21:19 GMT
65
- Content-Type:
66
- - text/html;charset=UTF-8
67
- Connection:
68
- - keep-alive
69
- Pragma:
70
- - no-cache
71
- Expires:
72
- - Thu, 01 Jan 1970 00:00:00 GMT
73
- Cache-Control:
74
- - no-cache, no-store
75
- Location:
76
- - http://mds-sandbox.datacite.org/metadata/10.5072/0000-03VC
77
- Access-Control-Allow-Origin:
78
- - "*"
79
- Access-Control-Allow-Methods:
80
- - GET, POST, OPTIONS
81
- body:
82
- encoding: UTF-8
83
- string: OK (10.5072/0000-03VC)
84
- http_version:
85
- recorded_at: Mon, 02 Jan 2017 21:21:19 GMT
86
- - request:
87
- method: put
88
- uri: https://mds-sandbox.datacite.org/doi/10.5072/0000-03VC
89
- body:
90
- encoding: UTF-8
91
- string: |-
92
- doi=10.5072/0000-03VC
93
- url=https://blog.datacite.org/cool-dois/
94
- headers:
95
- User-Agent:
96
- - Maremma - https://github.com/datacite/maremma
97
- Content-Type:
98
- - text/plain;charset=UTF-8
99
- Accept:
100
- - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
101
- Authorization:
102
- - Basic <MDS_TOKEN>
103
- response:
104
- status:
105
- code: 201
106
- message: ''
107
- headers:
108
- Server:
109
- - openresty/1.11.2.1
110
- Date:
111
- - Mon, 02 Jan 2017 21:21:19 GMT
112
- Content-Type:
113
- - text/html;charset=UTF-8
114
- Connection:
115
- - keep-alive
116
- Pragma:
117
- - no-cache
118
- Expires:
119
- - Thu, 01 Jan 1970 00:00:00 GMT
120
- Cache-Control:
121
- - no-cache, no-store
122
- Access-Control-Allow-Origin:
123
- - "*"
124
- Access-Control-Allow-Methods:
125
- - GET, POST, OPTIONS
126
- body:
127
- encoding: UTF-8
128
- string: OK
129
- http_version:
130
- recorded_at: Mon, 02 Jan 2017 21:21:19 GMT
131
- - request:
132
- method: post
133
- uri: https://mds-sandbox.datacite.org/media/10.5072/0000-03VC
134
- body:
135
- encoding: UTF-8
136
- string: application/xml=https://blog.datacite.org/cool-dois/cool-dois.xml
137
- headers:
138
- User-Agent:
139
- - Maremma - https://github.com/datacite/maremma
140
- Content-Type:
141
- - text/plain;charset=UTF-8
142
- Accept:
143
- - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
144
- Authorization:
145
- - Basic <MDS_TOKEN>
146
- response:
147
- status:
148
- code: 200
149
- message: ''
150
- headers:
151
- Server:
152
- - openresty/1.11.2.1
153
- Date:
154
- - Mon, 02 Jan 2017 21:21:19 GMT
155
- Content-Type:
156
- - text/html;charset=UTF-8
157
- Connection:
158
- - keep-alive
159
- Pragma:
160
- - no-cache
161
- Expires:
162
- - Thu, 01 Jan 1970 00:00:00 GMT
163
- Cache-Control:
164
- - no-cache, no-store
165
- Access-Control-Allow-Origin:
166
- - "*"
167
- Access-Control-Allow-Methods:
168
- - GET, POST, OPTIONS
169
- body:
170
- encoding: UTF-8
171
- string: OK
172
- http_version:
173
- recorded_at: Mon, 02 Jan 2017 21:21:19 GMT
174
- recorded_with: VCR 3.0.3
@@ -1,174 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://mds-sandbox.datacite.org/metadata
6
- body:
7
- encoding: UTF-8
8
- string: |
9
- <?xml version="1.0" encoding="UTF-8"?>
10
- <resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4/metadata.xsd">
11
- <identifier identifierType="DOI">10.5072/0000-03VC</identifier>
12
- <creators>
13
- <creator>
14
- <creatorName>Fenner, Martin</creatorName>
15
- <givenName>Martin</givenName>
16
- <familyName>Fenner</familyName>
17
- <nameIdentifier schemeURI="http://orcid.org/" nameIdentifierScheme="ORCID">0000-0003-1419-2405</nameIdentifier>
18
- </creator>
19
- </creators>
20
- <titles>
21
- <title>Cool DOI's</title>
22
- </titles>
23
- <publisher>DataCite</publisher>
24
- <publicationYear>2016</publicationYear>
25
- <resourceType resourceTypeGeneral="Text">BlogPosting</resourceType>
26
- <alternateIdentifiers>
27
- <alternateIdentifier alternateIdentifierType="Local accession number">MS-123</alternateIdentifier>
28
- </alternateIdentifiers>
29
- <subjects>
30
- <subject>doi</subject>
31
- </subjects>
32
- <dates>
33
- <date dateType="Created">2016-12-15</date>
34
- <date dateType="Issued">2016-12-15</date>
35
- <date dateType="Updated">2016-12-15</date>
36
- </dates>
37
- <relatedIdentifiers>
38
- <relatedIdentifier relatedIdentifierType="URL" relationType="References">https://www.w3.org/Provider/Style/URI</relatedIdentifier>
39
- <relatedIdentifier relatedIdentifierType="DOI" relationType="References">10.1371/JOURNAL.PONE.0115253</relatedIdentifier>
40
- <relatedIdentifier relatedIdentifierType="URL" relationType="IsPartOf">https://blog.datacite.org/</relatedIdentifier>
41
- </relatedIdentifiers>
42
- <version>1.0</version>
43
- <descriptions>
44
- <description descriptionType="Abstract">In 1998 Tim Berners-Lee coined the term cool URIs (1998), that is URIs that don’t change. We know that URLs referenced in the scholarly literature are often not cool, leading to link rot (Klein et al., 2014) and making it hard or impossible to find...</description>
45
- </descriptions>
46
- </resource>
47
- headers:
48
- User-Agent:
49
- - Maremma - https://github.com/datacite/maremma
50
- Content-Type:
51
- - application/xml;charset=UTF-8
52
- Accept:
53
- - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
54
- Authorization:
55
- - Basic <MDS_TOKEN>
56
- response:
57
- status:
58
- code: 201
59
- message: ''
60
- headers:
61
- Server:
62
- - openresty/1.11.2.1
63
- Date:
64
- - Mon, 02 Jan 2017 21:28:24 GMT
65
- Content-Type:
66
- - text/html;charset=UTF-8
67
- Connection:
68
- - keep-alive
69
- Pragma:
70
- - no-cache
71
- Expires:
72
- - Thu, 01 Jan 1970 00:00:00 GMT
73
- Cache-Control:
74
- - no-cache, no-store
75
- Location:
76
- - http://mds-sandbox.datacite.org/metadata/10.5072/0000-03VC
77
- Access-Control-Allow-Origin:
78
- - "*"
79
- Access-Control-Allow-Methods:
80
- - GET, POST, OPTIONS
81
- body:
82
- encoding: UTF-8
83
- string: OK (10.5072/0000-03VC)
84
- http_version:
85
- recorded_at: Mon, 02 Jan 2017 21:28:24 GMT
86
- - request:
87
- method: put
88
- uri: https://mds-sandbox.datacite.org/doi/10.5072/0000-03VC
89
- body:
90
- encoding: UTF-8
91
- string: |-
92
- doi=10.5072/0000-03VC
93
- url=https://blog.datacite.org/cool-dois/
94
- headers:
95
- User-Agent:
96
- - Maremma - https://github.com/datacite/maremma
97
- Content-Type:
98
- - text/plain;charset=UTF-8
99
- Accept:
100
- - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
101
- Authorization:
102
- - Basic <MDS_TOKEN>
103
- response:
104
- status:
105
- code: 201
106
- message: ''
107
- headers:
108
- Server:
109
- - openresty/1.11.2.1
110
- Date:
111
- - Mon, 02 Jan 2017 21:28:24 GMT
112
- Content-Type:
113
- - text/html;charset=UTF-8
114
- Connection:
115
- - keep-alive
116
- Pragma:
117
- - no-cache
118
- Expires:
119
- - Thu, 01 Jan 1970 00:00:00 GMT
120
- Cache-Control:
121
- - no-cache, no-store
122
- Access-Control-Allow-Origin:
123
- - "*"
124
- Access-Control-Allow-Methods:
125
- - GET, POST, OPTIONS
126
- body:
127
- encoding: UTF-8
128
- string: OK
129
- http_version:
130
- recorded_at: Mon, 02 Jan 2017 21:28:24 GMT
131
- - request:
132
- method: post
133
- uri: https://mds-sandbox.datacite.org/media/10.5072/0000-03VC
134
- body:
135
- encoding: UTF-8
136
- string: application/xml=https://blog.datacite.org/cool-dois/cool-dois.xml
137
- headers:
138
- User-Agent:
139
- - Maremma - https://github.com/datacite/maremma
140
- Content-Type:
141
- - text/plain;charset=UTF-8
142
- Accept:
143
- - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
144
- Authorization:
145
- - Basic <MDS_TOKEN>
146
- response:
147
- status:
148
- code: 200
149
- message: ''
150
- headers:
151
- Server:
152
- - openresty/1.11.2.1
153
- Date:
154
- - Mon, 02 Jan 2017 21:28:24 GMT
155
- Content-Type:
156
- - text/html;charset=UTF-8
157
- Connection:
158
- - keep-alive
159
- Pragma:
160
- - no-cache
161
- Expires:
162
- - Thu, 01 Jan 1970 00:00:00 GMT
163
- Cache-Control:
164
- - no-cache, no-store
165
- Access-Control-Allow-Origin:
166
- - "*"
167
- Access-Control-Allow-Methods:
168
- - GET, POST, OPTIONS
169
- body:
170
- encoding: UTF-8
171
- string: OK
172
- http_version:
173
- recorded_at: Mon, 02 Jan 2017 21:28:24 GMT
174
- recorded_with: VCR 3.0.3