datacite 0.2.3 → 0.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b4e07720b65e4a47881eb7d5905c6050c4104b6c9a728fa234d2199b4c52986
4
- data.tar.gz: 74edad75a1c915582b4867fb69b45e12972fd2b88720652d3afbdefff50e25ba
3
+ metadata.gz: 8c402c810fe15ec361ab43cc1d16eb828cf20996453c0c1ef6ebe9c37a843eb3
4
+ data.tar.gz: 77b49fcbb192cf95d5ede1eb4718fa1fa200c57b4a40f2780e19052bbdd96e09
5
5
  SHA512:
6
- metadata.gz: 8337bda82aabb3d4bac9f5546777c22f49705bbae2e6b8c450a017635be9b0b003cb99b76e062f3e1f042e0f30995195ed48e0dde2eaf8e53ac57120b858ba8c
7
- data.tar.gz: 7423c99f2869c1dd25999606e810aefb4469295dd4141e6b65fc929cab3e8113fa1e42c5dd844b4fc0aba099558546ad3d6d4f414a107c34127f257b7c5efa54
6
+ metadata.gz: f6cbae355c732c44531a9b5b8378ede3daf2616b86b473a3355d548b572306f7860a4c697ab6dcf74b380aaf677e06dc2748c16a98bd0bebf840e2ca9bb254de
7
+ data.tar.gz: 955cbd7fdcf0ff420c255070a7586c333b14e1960defd74140f2650228d7f6654a542e21d87629be3dc8a8f8966904e39622498052e9d725c05d1e97b5012b65
@@ -6,11 +6,11 @@ jobs:
6
6
  build:
7
7
  runs-on: ubuntu-latest
8
8
  steps:
9
- - uses: actions/checkout@v2
9
+ - uses: actions/checkout@v3
10
10
  - name: Set up Ruby
11
11
  uses: ruby/setup-ruby@v1
12
12
  with:
13
- ruby-version: 2.7.2
13
+ ruby-version: 3.0
14
14
  bundler-cache: true
15
15
  - name: Run the default task
16
16
  run: bundle exec rake
data/.rubocop.yml CHANGED
@@ -1,10 +1,21 @@
1
+ require:
2
+ - rubocop-rake
3
+ - rubocop-rspec
4
+
1
5
  AllCops:
2
- TargetRubyVersion: 2.7
6
+ TargetRubyVersion: 3.0
3
7
 
4
8
  Metrics/BlockLength:
5
9
  Exclude:
10
+ - datacite.gemspec
6
11
  - spec/**/*_spec.rb
7
12
 
13
+ RSpec/MultipleExpectations:
14
+ Max: 5 # default 1
15
+
16
+ RSpec/MultipleMemoizedHelpers:
17
+ Enabled: false
18
+
8
19
  Style/StringLiterals:
9
20
  Enabled: true
10
21
  EnforcedStyle: double_quotes
@@ -16,75 +27,299 @@ Style/StringLiteralsInInterpolation:
16
27
  Layout/LineLength:
17
28
  Max: 120
18
29
 
19
- Gemspec/DateAssignment: # (new in 1.10)
30
+ Gemspec/DeprecatedAttributeAssignment: # new in 1.30
31
+ Enabled: true
32
+ Gemspec/DevelopmentDependencies: # new in 1.44
33
+ Enabled: true
34
+ Gemspec/RequireMFA: # new in 1.23
35
+ Enabled: true
36
+ Layout/LineContinuationLeadingSpace: # new in 1.31
37
+ Enabled: true
38
+ Layout/LineContinuationSpacing: # new in 1.31
39
+ Enabled: true
40
+ Layout/LineEndStringConcatenationIndentation: # new in 1.18
41
+ Enabled: true
42
+ Layout/SpaceBeforeBrackets: # new in 1.7
43
+ Enabled: true
44
+ Lint/AmbiguousAssignment: # new in 1.7
45
+ Enabled: true
46
+ Lint/AmbiguousOperatorPrecedence: # new in 1.21
47
+ Enabled: true
48
+ Lint/AmbiguousRange: # new in 1.19
49
+ Enabled: true
50
+ Lint/ConstantOverwrittenInRescue: # new in 1.31
51
+ Enabled: true
52
+ Lint/DeprecatedConstants: # new in 1.8
53
+ Enabled: true
54
+ Lint/DuplicateBranch: # new in 1.3
55
+ Enabled: true
56
+ Lint/DuplicateMagicComment: # new in 1.37
57
+ Enabled: true
58
+ Lint/DuplicateMatchPattern: # new in 1.50
59
+ Enabled: true
60
+ Lint/DuplicateRegexpCharacterClassElement: # new in 1.1
61
+ Enabled: true
62
+ Lint/EmptyBlock: # new in 1.1
63
+ Enabled: true
64
+ Lint/EmptyClass: # new in 1.3
65
+ Enabled: true
66
+ Lint/EmptyInPattern: # new in 1.16
67
+ Enabled: true
68
+ Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
69
+ Enabled: true
70
+ Lint/ItWithoutArgumentsInBlock: # new in 1.59
71
+ Enabled: true
72
+ Lint/LambdaWithoutLiteralBlock: # new in 1.8
73
+ Enabled: true
74
+ Lint/LiteralAssignmentInCondition: # new in 1.58
75
+ Enabled: true
76
+ Lint/MixedCaseRange: # new in 1.53
77
+ Enabled: true
78
+ Lint/NoReturnInBeginEndBlocks: # new in 1.2
79
+ Enabled: true
80
+ Lint/NonAtomicFileOperation: # new in 1.31
81
+ Enabled: true
82
+ Lint/NumberedParameterAssignment: # new in 1.9
83
+ Enabled: true
84
+ Lint/OrAssignmentToConstant: # new in 1.9
85
+ Enabled: true
86
+ Lint/RedundantDirGlobSort: # new in 1.8
87
+ Enabled: true
88
+ Lint/RedundantRegexpQuantifiers: # new in 1.53
89
+ Enabled: true
90
+ Lint/RefinementImportMethods: # new in 1.27
91
+ Enabled: true
92
+ Lint/RequireRangeParentheses: # new in 1.32
93
+ Enabled: true
94
+ Lint/RequireRelativeSelfPath: # new in 1.22
95
+ Enabled: true
96
+ Lint/SymbolConversion: # new in 1.9
97
+ Enabled: true
98
+ Lint/ToEnumArguments: # new in 1.1
99
+ Enabled: true
100
+ Lint/TripleQuotes: # new in 1.9
101
+ Enabled: true
102
+ Lint/UnexpectedBlockArity: # new in 1.5
103
+ Enabled: true
104
+ Lint/UnmodifiedReduceAccumulator: # new in 1.1
105
+ Enabled: true
106
+ Lint/UselessRescue: # new in 1.43
107
+ Enabled: true
108
+ Lint/UselessRuby2Keywords: # new in 1.23
109
+ Enabled: true
110
+ Metrics/CollectionLiteralLength: # new in 1.47
111
+ Enabled: true
112
+ Naming/BlockForwarding: # new in 1.24
113
+ Enabled: true
114
+ Security/CompoundHash: # new in 1.28
115
+ Enabled: true
116
+ Security/IoMethods: # new in 1.22
117
+ Enabled: true
118
+ Style/ArgumentsForwarding: # new in 1.1
119
+ Enabled: true
120
+ Style/ArrayIntersect: # new in 1.40
121
+ Enabled: true
122
+ Style/CollectionCompact: # new in 1.2
123
+ Enabled: true
124
+ Style/ComparableClamp: # new in 1.44
125
+ Enabled: true
126
+ Style/ConcatArrayLiterals: # new in 1.41
127
+ Enabled: true
128
+ Style/DataInheritance: # new in 1.49
129
+ Enabled: true
130
+ Style/DirEmpty: # new in 1.48
131
+ Enabled: true
132
+ Style/DocumentDynamicEvalDefinition: # new in 1.1
133
+ Enabled: true
134
+ Style/EmptyHeredoc: # new in 1.32
135
+ Enabled: true
136
+ Style/EndlessMethod: # new in 1.8
137
+ Enabled: true
138
+ Style/EnvHome: # new in 1.29
139
+ Enabled: true
140
+ Style/ExactRegexpMatch: # new in 1.51
141
+ Enabled: true
142
+ Style/FetchEnvVar: # new in 1.28
143
+ Enabled: true
144
+ Style/FileEmpty: # new in 1.48
145
+ Enabled: true
146
+ Style/FileRead: # new in 1.24
147
+ Enabled: true
148
+ Style/FileWrite: # new in 1.24
149
+ Enabled: true
150
+ Style/HashConversion: # new in 1.10
151
+ Enabled: true
152
+ Style/HashExcept: # new in 1.7
153
+ Enabled: true
154
+ Style/IfWithBooleanLiteralBranches: # new in 1.9
155
+ Enabled: true
156
+ Style/InPatternThen: # new in 1.16
157
+ Enabled: true
158
+ Style/MagicCommentFormat: # new in 1.35
159
+ Enabled: true
160
+ Style/MapCompactWithConditionalBlock: # new in 1.30
161
+ Enabled: true
162
+ Style/MapToHash: # new in 1.24
163
+ Enabled: true
164
+ Style/MapToSet: # new in 1.42
165
+ Enabled: true
166
+ Style/MinMaxComparison: # new in 1.42
167
+ Enabled: true
168
+ Style/MultilineInPatternThen: # new in 1.16
169
+ Enabled: true
170
+ Style/NegatedIfElseCondition: # new in 1.2
171
+ Enabled: true
172
+ Style/NestedFileDirname: # new in 1.26
173
+ Enabled: true
174
+ Style/NilLambda: # new in 1.3
175
+ Enabled: true
176
+ Style/NumberedParameters: # new in 1.22
177
+ Enabled: true
178
+ Style/NumberedParametersLimit: # new in 1.22
179
+ Enabled: true
180
+ Style/ObjectThen: # new in 1.28
181
+ Enabled: true
182
+ Style/OpenStructUse: # new in 1.23
183
+ Enabled: true
184
+ Style/OperatorMethodCall: # new in 1.37
185
+ Enabled: true
186
+ Style/QuotedSymbols: # new in 1.16
187
+ Enabled: true
188
+ Style/RedundantArgument: # new in 1.4
189
+ Enabled: true
190
+ Style/RedundantArrayConstructor: # new in 1.52
191
+ Enabled: true
192
+ Style/RedundantConstantBase: # new in 1.40
193
+ Enabled: true
194
+ Style/RedundantCurrentDirectoryInPath: # new in 1.53
195
+ Enabled: true
196
+ Style/RedundantDoubleSplatHashBraces: # new in 1.41
197
+ Enabled: true
198
+ Style/RedundantEach: # new in 1.38
199
+ Enabled: true
200
+ Style/RedundantFilterChain: # new in 1.52
201
+ Enabled: true
202
+ Style/RedundantHeredocDelimiterQuotes: # new in 1.45
203
+ Enabled: true
204
+ Style/RedundantInitialize: # new in 1.27
205
+ Enabled: true
206
+ Style/RedundantLineContinuation: # new in 1.49
207
+ Enabled: true
208
+ Style/RedundantRegexpArgument: # new in 1.53
209
+ Enabled: true
210
+ Style/RedundantRegexpConstructor: # new in 1.52
211
+ Enabled: true
212
+ Style/RedundantSelfAssignmentBranch: # new in 1.19
213
+ Enabled: true
214
+ Style/RedundantStringEscape: # new in 1.37
215
+ Enabled: true
216
+ Style/ReturnNilInPredicateMethodDefinition: # new in 1.53
217
+ Enabled: true
218
+ Style/SelectByRegexp: # new in 1.22
219
+ Enabled: true
220
+ Style/SingleLineDoEndBlock: # new in 1.57
221
+ Enabled: true
222
+ Style/StringChars: # new in 1.12
223
+ Enabled: true
224
+ Style/SuperWithArgsParentheses: # new in 1.58
225
+ Enabled: true
226
+ Style/SwapValues: # new in 1.1
227
+ Enabled: true
228
+ Style/YAMLFileRead: # new in 1.53
229
+ Enabled: true
230
+ Capybara/ClickLinkOrButtonStyle: # new in 2.19
231
+ Enabled: true
232
+ Capybara/MatchStyle: # new in 2.17
233
+ Enabled: true
234
+ Capybara/NegationMatcher: # new in 2.14
235
+ Enabled: true
236
+ Capybara/RedundantWithinFind: # new in 2.20
237
+ Enabled: true
238
+ Capybara/SpecificActions: # new in 2.14
239
+ Enabled: true
240
+ Capybara/SpecificFinders: # new in 2.13
241
+ Enabled: true
242
+ Capybara/SpecificMatcher: # new in 2.12
243
+ Enabled: true
244
+ Capybara/RSpec/HaveSelector: # new in 2.19
245
+ Enabled: true
246
+ Capybara/RSpec/PredicateMatcher: # new in 2.19
247
+ Enabled: true
248
+ FactoryBot/AssociationStyle: # new in 2.23
249
+ Enabled: true
250
+ FactoryBot/ConsistentParenthesesStyle: # new in 2.14
251
+ Enabled: true
252
+ FactoryBot/ExcessiveCreateList: # new in 2.25
253
+ Enabled: true
254
+ FactoryBot/FactoryAssociationWithStrategy: # new in 2.23
20
255
  Enabled: true
21
- Layout/LineEndStringConcatenationIndentation: # (new in 1.18)
256
+ FactoryBot/FactoryNameStyle: # new in 2.16
22
257
  Enabled: true
23
- Layout/SpaceBeforeBrackets: # (new in 1.7)
258
+ FactoryBot/IdSequence: # new in 2.24
24
259
  Enabled: true
25
- Lint/AmbiguousAssignment: # (new in 1.7)
260
+ FactoryBot/RedundantFactoryOption: # new in 2.23
26
261
  Enabled: true
27
- Lint/DeprecatedConstants: # (new in 1.8)
262
+ FactoryBot/SyntaxMethods: # new in 2.7
28
263
  Enabled: true
29
- Lint/DuplicateBranch: # (new in 1.3)
264
+ RSpec/BeEmpty: # new in 2.20
30
265
  Enabled: true
31
- Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
266
+ RSpec/BeEq: # new in 2.9.0
32
267
  Enabled: true
33
- Lint/EmptyBlock: # (new in 1.1)
268
+ RSpec/BeNil: # new in 2.9.0
34
269
  Enabled: true
35
- Lint/EmptyClass: # (new in 1.3)
270
+ RSpec/ChangeByZero: # new in 2.11
36
271
  Enabled: true
37
- Lint/EmptyInPattern: # (new in 1.16)
272
+ RSpec/ContainExactly: # new in 2.19
38
273
  Enabled: true
39
- Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
274
+ RSpec/DuplicatedMetadata: # new in 2.16
40
275
  Enabled: true
41
- Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
276
+ RSpec/EmptyMetadata: # new in 2.24
42
277
  Enabled: true
43
- Lint/NumberedParameterAssignment: # (new in 1.9)
278
+ RSpec/Eq: # new in 2.24
44
279
  Enabled: true
45
- Lint/OrAssignmentToConstant: # (new in 1.9)
280
+ RSpec/ExcessiveDocstringSpacing: # new in 2.5
46
281
  Enabled: true
47
- Lint/RedundantDirGlobSort: # (new in 1.8)
282
+ RSpec/IdenticalEqualityAssertion: # new in 2.4
48
283
  Enabled: true
49
- Lint/SymbolConversion: # (new in 1.9)
284
+ RSpec/IndexedLet: # new in 2.20
50
285
  Enabled: true
51
- Lint/ToEnumArguments: # (new in 1.1)
286
+ RSpec/MatchArray: # new in 2.19
52
287
  Enabled: true
53
- Lint/TripleQuotes: # (new in 1.9)
288
+ RSpec/MetadataStyle: # new in 2.24
54
289
  Enabled: true
55
- Lint/UnexpectedBlockArity: # (new in 1.5)
290
+ RSpec/NoExpectationExample: # new in 2.13
56
291
  Enabled: true
57
- Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
292
+ RSpec/PendingWithoutReason: # new in 2.16
58
293
  Enabled: true
59
- Naming/InclusiveLanguage: # (new in 1.18)
294
+ RSpec/ReceiveMessages: # new in 2.23
60
295
  Enabled: true
61
- Style/ArgumentsForwarding: # (new in 1.1)
296
+ RSpec/RedundantAround: # new in 2.19
62
297
  Enabled: true
63
- Style/CollectionCompact: # (new in 1.2)
298
+ RSpec/RedundantPredicateMatcher: # new in 2.26
64
299
  Enabled: true
65
- Style/DocumentDynamicEvalDefinition: # (new in 1.1)
300
+ RSpec/RemoveConst: # new in 2.26
66
301
  Enabled: true
67
- Style/EndlessMethod: # (new in 1.8)
302
+ RSpec/SkipBlockInsideExample: # new in 2.19
68
303
  Enabled: true
69
- Style/HashConversion: # (new in 1.10)
304
+ RSpec/SortMetadata: # new in 2.14
70
305
  Enabled: true
71
- Style/HashExcept: # (new in 1.7)
306
+ RSpec/SpecFilePathFormat: # new in 2.24
72
307
  Enabled: true
73
- Style/IfWithBooleanLiteralBranches: # (new in 1.9)
308
+ RSpec/SpecFilePathSuffix: # new in 2.24
74
309
  Enabled: true
75
- Style/InPatternThen: # (new in 1.16)
310
+ RSpec/SubjectDeclaration: # new in 2.5
76
311
  Enabled: true
77
- Style/MultilineInPatternThen: # (new in 1.16)
312
+ RSpec/VerifiedDoubleReference: # new in 2.10.0
78
313
  Enabled: true
79
- Style/NegatedIfElseCondition: # (new in 1.2)
314
+ RSpec/Rails/AvoidSetupHook: # new in 2.4
80
315
  Enabled: true
81
- Style/NilLambda: # (new in 1.3)
316
+ RSpec/Rails/HaveHttpStatus: # new in 2.12
82
317
  Enabled: true
83
- Style/QuotedSymbols: # (new in 1.16)
318
+ RSpec/Rails/InferredSpecType: # new in 2.14
84
319
  Enabled: true
85
- Style/RedundantArgument: # (new in 1.4)
320
+ RSpec/Rails/MinitestAssertions: # new in 2.17
86
321
  Enabled: true
87
- Style/StringChars: # (new in 1.12)
322
+ RSpec/Rails/NegationBeValid: # new in 2.23
88
323
  Enabled: true
89
- Style/SwapValues: # (new in 1.1)
324
+ RSpec/Rails/TravelAround: # new in 2.19
90
325
  Enabled: true
data/Gemfile CHANGED
@@ -5,13 +5,12 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in datacite.gemspec
6
6
  gemspec
7
7
 
8
+ # Specify development dependencies here
9
+ gem "base64"
10
+ gem "byebug"
8
11
  gem "rake", "~> 13.0"
9
-
10
12
  gem "rspec", "~> 3.0"
11
-
12
13
  gem "rubocop", "~> 1.7"
13
-
14
14
  gem "rubocop-rake", "~> 0.6.0"
15
15
  gem "rubocop-rspec", "~> 2.4"
16
-
17
16
  gem "webmock", "~> 3.13"
data/Gemfile.lock CHANGED
@@ -1,103 +1,117 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- datacite (0.2.3)
4
+ datacite (0.4.0)
5
5
  dry-monads (~> 1.3)
6
- faraday (~> 1.4)
7
- faraday_middleware (~> 1.0)
6
+ faraday (~> 2.0)
8
7
  json_schema (~> 0.21.0)
9
8
  zeitwerk (~> 2.4)
10
9
 
11
10
  GEM
12
11
  remote: https://rubygems.org/
13
12
  specs:
14
- addressable (2.8.0)
15
- public_suffix (>= 2.0.2, < 5.0)
13
+ addressable (2.8.7)
14
+ public_suffix (>= 2.0.2, < 7.0)
16
15
  ast (2.4.2)
17
- concurrent-ruby (1.1.9)
18
- crack (0.4.5)
16
+ base64 (0.2.0)
17
+ bigdecimal (3.1.9)
18
+ byebug (11.1.3)
19
+ concurrent-ruby (1.3.4)
20
+ crack (1.0.0)
21
+ bigdecimal
19
22
  rexml
20
- diff-lcs (1.4.4)
21
- dry-core (0.7.1)
23
+ diff-lcs (1.5.1)
24
+ dry-core (1.1.0)
22
25
  concurrent-ruby (~> 1.0)
23
- dry-monads (1.4.0)
26
+ logger
27
+ zeitwerk (~> 2.6)
28
+ dry-monads (1.7.0)
24
29
  concurrent-ruby (~> 1.0)
25
- dry-core (~> 0.7)
26
- faraday (1.7.1)
27
- faraday-em_http (~> 1.0)
28
- faraday-em_synchrony (~> 1.0)
29
- faraday-excon (~> 1.1)
30
- faraday-httpclient (~> 1.0.1)
31
- faraday-net_http (~> 1.0)
32
- faraday-net_http_persistent (~> 1.1)
33
- faraday-patron (~> 1.0)
34
- faraday-rack (~> 1.0)
35
- multipart-post (>= 1.2, < 3)
36
- ruby2_keywords (>= 0.0.4)
37
- faraday-em_http (1.0.0)
38
- faraday-em_synchrony (1.0.0)
39
- faraday-excon (1.1.0)
40
- faraday-httpclient (1.0.1)
41
- faraday-net_http (1.0.1)
42
- faraday-net_http_persistent (1.2.0)
43
- faraday-patron (1.0.0)
44
- faraday-rack (1.0.0)
45
- faraday_middleware (1.1.0)
46
- faraday (~> 1.0)
47
- hashdiff (1.0.1)
30
+ dry-core (~> 1.1)
31
+ zeitwerk (~> 2.6)
32
+ faraday (2.12.2)
33
+ faraday-net_http (>= 2.0, < 3.5)
34
+ json
35
+ logger
36
+ faraday-net_http (3.4.0)
37
+ net-http (>= 0.5.0)
38
+ hashdiff (1.1.2)
39
+ json (2.9.1)
48
40
  json_schema (0.21.0)
49
- multipart-post (2.1.1)
50
- parallel (1.20.1)
51
- parser (3.0.1.1)
41
+ language_server-protocol (3.17.0.3)
42
+ logger (1.6.5)
43
+ net-http (0.6.0)
44
+ uri
45
+ parallel (1.26.3)
46
+ parser (3.3.6.0)
52
47
  ast (~> 2.4.1)
53
- public_suffix (4.0.6)
54
- rainbow (3.0.0)
55
- rake (13.0.4)
56
- regexp_parser (2.1.1)
57
- rexml (3.2.5)
58
- rspec (3.10.0)
59
- rspec-core (~> 3.10.0)
60
- rspec-expectations (~> 3.10.0)
61
- rspec-mocks (~> 3.10.0)
62
- rspec-core (3.10.1)
63
- rspec-support (~> 3.10.0)
64
- rspec-expectations (3.10.1)
48
+ racc
49
+ public_suffix (6.0.1)
50
+ racc (1.8.1)
51
+ rainbow (3.1.1)
52
+ rake (13.2.1)
53
+ regexp_parser (2.10.0)
54
+ rexml (3.4.0)
55
+ rspec (3.13.0)
56
+ rspec-core (~> 3.13.0)
57
+ rspec-expectations (~> 3.13.0)
58
+ rspec-mocks (~> 3.13.0)
59
+ rspec-core (3.13.2)
60
+ rspec-support (~> 3.13.0)
61
+ rspec-expectations (3.13.3)
65
62
  diff-lcs (>= 1.2.0, < 2.0)
66
- rspec-support (~> 3.10.0)
67
- rspec-mocks (3.10.2)
63
+ rspec-support (~> 3.13.0)
64
+ rspec-mocks (3.13.2)
68
65
  diff-lcs (>= 1.2.0, < 2.0)
69
- rspec-support (~> 3.10.0)
70
- rspec-support (3.10.2)
71
- rubocop (1.18.3)
66
+ rspec-support (~> 3.13.0)
67
+ rspec-support (3.13.2)
68
+ rubocop (1.70.0)
69
+ json (~> 2.3)
70
+ language_server-protocol (>= 3.17.0)
72
71
  parallel (~> 1.10)
73
- parser (>= 3.0.0.0)
72
+ parser (>= 3.3.0.2)
74
73
  rainbow (>= 2.2.2, < 4.0)
75
- regexp_parser (>= 1.8, < 3.0)
76
- rexml
77
- rubocop-ast (>= 1.7.0, < 2.0)
74
+ regexp_parser (>= 2.9.3, < 3.0)
75
+ rubocop-ast (>= 1.36.2, < 2.0)
78
76
  ruby-progressbar (~> 1.7)
79
- unicode-display_width (>= 1.4.0, < 3.0)
80
- rubocop-ast (1.7.0)
81
- parser (>= 3.0.1.1)
77
+ unicode-display_width (>= 2.4.0, < 4.0)
78
+ rubocop-ast (1.37.0)
79
+ parser (>= 3.3.1.0)
80
+ rubocop-capybara (2.21.0)
81
+ rubocop (~> 1.41)
82
+ rubocop-factory_bot (2.26.1)
83
+ rubocop (~> 1.61)
82
84
  rubocop-rake (0.6.0)
83
85
  rubocop (~> 1.0)
84
- rubocop-rspec (2.4.0)
85
- rubocop (~> 1.0)
86
- rubocop-ast (>= 1.1.0)
87
- ruby-progressbar (1.11.0)
88
- ruby2_keywords (0.0.5)
89
- unicode-display_width (2.0.0)
90
- webmock (3.13.0)
91
- addressable (>= 2.3.6)
86
+ rubocop-rspec (2.31.0)
87
+ rubocop (~> 1.40)
88
+ rubocop-capybara (~> 2.17)
89
+ rubocop-factory_bot (~> 2.22)
90
+ rubocop-rspec_rails (~> 2.28)
91
+ rubocop-rspec_rails (2.29.1)
92
+ rubocop (~> 1.61)
93
+ ruby-progressbar (1.13.0)
94
+ unicode-display_width (3.1.3)
95
+ unicode-emoji (~> 4.0, >= 4.0.4)
96
+ unicode-emoji (4.0.4)
97
+ uri (1.0.2)
98
+ webmock (3.24.0)
99
+ addressable (>= 2.8.0)
92
100
  crack (>= 0.3.2)
93
101
  hashdiff (>= 0.4.0, < 2.0.0)
94
- zeitwerk (2.4.2)
102
+ zeitwerk (2.7.1)
95
103
 
96
104
  PLATFORMS
105
+ arm64-darwin-23
106
+ arm64-darwin-24
97
107
  x86_64-darwin-19
108
+ x86_64-darwin-21
109
+ x86_64-darwin-22
98
110
  x86_64-linux
99
111
 
100
112
  DEPENDENCIES
113
+ base64
114
+ byebug
101
115
  datacite!
102
116
  rake (~> 13.0)
103
117
  rspec (~> 3.0)
@@ -107,4 +121,4 @@ DEPENDENCIES
107
121
  webmock (~> 3.13)
108
122
 
109
123
  BUNDLED WITH
110
- 2.2.21
124
+ 2.4.13
data/README.md CHANGED
@@ -73,6 +73,17 @@ result.either(
73
73
  )
74
74
  ```
75
75
 
76
+ ### Determine if a DOI exists
77
+
78
+ ```ruby
79
+ result = client.exists?(id: '10.0001/bc123df4567')
80
+
81
+ result.either(
82
+ -> response { response },
83
+ -> response { raise("Something went wrong", response.status) }
84
+ )
85
+
86
+
76
87
  ### Validation
77
88
  This gem validates using a json schema from https://github.com/datacite/schema/blob/master/source/json/kernel-4.3/datacite_4.3_schema.json
78
89
 
@@ -80,6 +91,7 @@ We've made the following changes:
80
91
  * relax the required fields (https://github.com/datacite/schema/issues/97)
81
92
  * add event property (https://github.com/datacite/schema/issues/100)
82
93
  * add url property (https://github.com/datacite/schema/issues/101)
94
+ * add xml property to support Datacite 4.4 xml schema via the api (https://github.com/datacite/schema/issues/99)
83
95
 
84
96
  ## Development
85
97
 
data/datacite.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = "A Ruby client library for the DataCite REST API "
12
12
  spec.description = "See https://support.datacite.org/docs/api"
13
13
  spec.homepage = "https://github.com/sul-dlss/datacite-ruby"
14
- spec.required_ruby_version = ">= 2.7.0"
14
+ spec.required_ruby_version = ">= 3.0"
15
15
 
16
16
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
17
17
 
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
 
31
31
  spec.add_dependency "dry-monads", "~> 1.3"
32
- spec.add_dependency "faraday", "~> 1.4"
33
- spec.add_dependency "faraday_middleware", "~> 1.0"
32
+ spec.add_dependency "faraday", "~> 2.0"
34
33
  spec.add_dependency "json_schema", "~> 0.21.0"
35
34
  spec.add_dependency "zeitwerk", "~> 2.4"
35
+ spec.metadata["rubygems_mfa_required"] = "true"
36
36
  end
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "faraday"
4
- require "faraday_middleware"
5
4
  require "dry/monads"
6
5
  require "json_schema"
7
6
 
@@ -13,13 +12,13 @@ module Datacite
13
12
  # @param [String] username
14
13
  # @param [String] password
15
14
  # @param [String] host
16
- def initialize(username:, password:, host: "api.test.datacite.org")
15
+ def initialize(username: nil, password: nil, host: "api.test.datacite.org")
17
16
  @conn = Faraday.new(
18
17
  url: "https://#{host}",
19
18
  headers: headers
20
19
  ) do |conn|
21
20
  conn.request :json
22
- conn.request(:basic_auth, username, password)
21
+ conn.request :authorization, :basic, username, password if username
23
22
  conn.response :json
24
23
  end
25
24
  end
@@ -57,6 +56,21 @@ module Datacite
57
56
  response.success? ? Success(Response.new(response)) : Failure(response)
58
57
  end
59
58
 
59
+ # Determines if a DOI exists
60
+ # @param [String] id
61
+ # @returns [Dry::Monads::Result]
62
+ def exists?(id:)
63
+ response = conn.head("/dois/#{id}")
64
+ case response.status
65
+ when 200
66
+ Success(true)
67
+ when 404
68
+ Success(false)
69
+ else
70
+ Failure(response)
71
+ end
72
+ end
73
+
60
74
  private
61
75
 
62
76
  # @returns [Dry::Monads::Result]
@@ -475,6 +475,9 @@
475
475
  "schemaVersion": {
476
476
  "type": "string",
477
477
  "const": "http://datacite.org/schema/kernel-4"
478
+ },
479
+ "xml": {
480
+ "type": "string"
478
481
  }
479
482
  },
480
483
  "additionalProperties": false
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Datacite
4
- VERSION = "0.2.3"
4
+ VERSION = "0.4.0"
5
5
  end
data/lib/datacite.rb CHANGED
@@ -2,11 +2,7 @@
2
2
 
3
3
  require "zeitwerk"
4
4
 
5
- loader = Zeitwerk::Loader.new
6
- loader.tag = File.basename(__FILE__, ".rb")
7
- loader.inflector = Zeitwerk::GemInflector.new(__FILE__)
8
- loader.push_dir(__dir__)
9
- loader.setup
5
+ Zeitwerk::Loader.for_gem.setup
10
6
 
11
7
  module Datacite
12
8
  class Error < StandardError; end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datacite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-13 00:00:00.000000000 Z
11
+ date: 2025-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-monads
@@ -30,28 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.4'
33
+ version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.4'
41
- - !ruby/object:Gem::Dependency
42
- name: faraday_middleware
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1.0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1.0'
40
+ version: '2.0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: json_schema
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -113,7 +99,8 @@ metadata:
113
99
  allowed_push_host: https://rubygems.org
114
100
  homepage_uri: https://github.com/sul-dlss/datacite-ruby
115
101
  source_code_uri: https://github.com/sul-dlss/datacite-ruby
116
- post_install_message:
102
+ rubygems_mfa_required: 'true'
103
+ post_install_message:
117
104
  rdoc_options: []
118
105
  require_paths:
119
106
  - lib
@@ -121,15 +108,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
121
108
  requirements:
122
109
  - - ">="
123
110
  - !ruby/object:Gem::Version
124
- version: 2.7.0
111
+ version: '3.0'
125
112
  required_rubygems_version: !ruby/object:Gem::Requirement
126
113
  requirements:
127
114
  - - ">="
128
115
  - !ruby/object:Gem::Version
129
116
  version: '0'
130
117
  requirements: []
131
- rubygems_version: 3.1.4
132
- signing_key:
118
+ rubygems_version: 3.5.11
119
+ signing_key:
133
120
  specification_version: 4
134
121
  summary: A Ruby client library for the DataCite REST API
135
122
  test_files: []