datacite 0.3.0 → 0.5.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 +4 -4
- data/.circleci/config.yml +11 -0
- data/.rubocop.yml +259 -45
- data/Gemfile +6 -7
- data/Gemfile.lock +89 -53
- data/README.md +28 -3
- data/datacite.gemspec +1 -1
- data/lib/datacite/client.rb +29 -2
- data/lib/datacite/schema.json +3 -0
- data/lib/datacite/version.rb +1 -1
- data/lib/datacite.rb +1 -5
- metadata +5 -5
- data/.github/workflows/main.yml +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14e944d80dc95aa79554d485193762732d942e6b17cc039cbd88bd2a390b9289
|
4
|
+
data.tar.gz: 7358ac61628a052e33c3bd82da253451135e87a9e584695b28022d33801ae0df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fd39012378ac1312ae25e38ac72797f58daec08db118b94548f898be989d5ef2a2dcf6e55d1a513333bc73ca21beeea32cf92387c312c6f1eb29cc906afb942
|
7
|
+
data.tar.gz: 3efbef3e7d82b69ba1b2c5df6c2b9423b0a618c10e41dba770e5102581fa5f4b75fa12b552b280de011d126211bab4cc89e343c6ce7c32f4a2704b2ed43c019d
|
data/.rubocop.yml
CHANGED
@@ -1,10 +1,21 @@
|
|
1
|
+
plugins:
|
2
|
+
- rubocop-rake
|
3
|
+
- rubocop-rspec
|
4
|
+
|
1
5
|
AllCops:
|
2
|
-
TargetRubyVersion:
|
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,108 +27,311 @@ Style/StringLiteralsInInterpolation:
|
|
16
27
|
Layout/LineLength:
|
17
28
|
Max: 120
|
18
29
|
|
19
|
-
Gemspec/
|
20
|
-
Enabled: true
|
21
|
-
Layout/LineEndStringConcatenationIndentation: # (new in 1.18)
|
30
|
+
Gemspec/DeprecatedAttributeAssignment: # new in 1.30
|
22
31
|
Enabled: true
|
23
|
-
|
32
|
+
Gemspec/DevelopmentDependencies: # new in 1.44
|
24
33
|
Enabled: true
|
25
|
-
|
26
|
-
Enabled: true
|
27
|
-
Lint/DeprecatedConstants: # (new in 1.8)
|
34
|
+
Gemspec/RequireMFA: # new in 1.23
|
28
35
|
Enabled: true
|
29
|
-
|
36
|
+
Layout/LineContinuationLeadingSpace: # new in 1.31
|
30
37
|
Enabled: true
|
31
|
-
|
38
|
+
Layout/LineContinuationSpacing: # new in 1.31
|
32
39
|
Enabled: true
|
33
|
-
|
40
|
+
Layout/LineEndStringConcatenationIndentation: # new in 1.18
|
34
41
|
Enabled: true
|
35
|
-
|
42
|
+
Layout/SpaceBeforeBrackets: # new in 1.7
|
36
43
|
Enabled: true
|
37
|
-
Lint/
|
44
|
+
Lint/AmbiguousAssignment: # new in 1.7
|
38
45
|
Enabled: true
|
39
|
-
Lint/
|
46
|
+
Lint/AmbiguousOperatorPrecedence: # new in 1.21
|
40
47
|
Enabled: true
|
41
|
-
Lint/
|
48
|
+
Lint/AmbiguousRange: # new in 1.19
|
42
49
|
Enabled: true
|
43
|
-
Lint/
|
50
|
+
Lint/ConstantOverwrittenInRescue: # new in 1.31
|
44
51
|
Enabled: true
|
45
|
-
Lint/
|
52
|
+
Lint/DeprecatedConstants: # new in 1.8
|
46
53
|
Enabled: true
|
47
|
-
Lint/
|
54
|
+
Lint/DuplicateBranch: # new in 1.3
|
48
55
|
Enabled: true
|
49
|
-
Lint/
|
56
|
+
Lint/DuplicateMagicComment: # new in 1.37
|
50
57
|
Enabled: true
|
51
|
-
Lint/
|
58
|
+
Lint/DuplicateMatchPattern: # new in 1.50
|
52
59
|
Enabled: true
|
53
|
-
Lint/
|
60
|
+
Lint/DuplicateRegexpCharacterClassElement: # new in 1.1
|
54
61
|
Enabled: true
|
55
|
-
Lint/
|
62
|
+
Lint/EmptyBlock: # new in 1.1
|
56
63
|
Enabled: true
|
57
|
-
Lint/
|
64
|
+
Lint/EmptyClass: # new in 1.3
|
58
65
|
Enabled: true
|
59
|
-
|
66
|
+
Lint/EmptyInPattern: # new in 1.16
|
60
67
|
Enabled: true
|
61
|
-
|
68
|
+
Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
|
62
69
|
Enabled: true
|
63
|
-
|
70
|
+
Lint/ItWithoutArgumentsInBlock: # new in 1.59
|
64
71
|
Enabled: true
|
65
|
-
|
72
|
+
Lint/LambdaWithoutLiteralBlock: # new in 1.8
|
66
73
|
Enabled: true
|
67
|
-
|
74
|
+
Lint/LiteralAssignmentInCondition: # new in 1.58
|
68
75
|
Enabled: true
|
69
|
-
|
76
|
+
Lint/MixedCaseRange: # new in 1.53
|
70
77
|
Enabled: true
|
71
|
-
|
78
|
+
Lint/NoReturnInBeginEndBlocks: # new in 1.2
|
72
79
|
Enabled: true
|
73
|
-
|
80
|
+
Lint/NonAtomicFileOperation: # new in 1.31
|
74
81
|
Enabled: true
|
75
|
-
|
82
|
+
Lint/NumberedParameterAssignment: # new in 1.9
|
76
83
|
Enabled: true
|
77
|
-
|
84
|
+
Lint/OrAssignmentToConstant: # new in 1.9
|
78
85
|
Enabled: true
|
79
|
-
|
86
|
+
Lint/RedundantDirGlobSort: # new in 1.8
|
80
87
|
Enabled: true
|
81
|
-
|
88
|
+
Lint/RedundantRegexpQuantifiers: # new in 1.53
|
82
89
|
Enabled: true
|
83
|
-
|
90
|
+
Lint/RefinementImportMethods: # new in 1.27
|
84
91
|
Enabled: true
|
85
|
-
|
92
|
+
Lint/RequireRangeParentheses: # new in 1.32
|
86
93
|
Enabled: true
|
87
|
-
|
94
|
+
Lint/RequireRelativeSelfPath: # new in 1.22
|
88
95
|
Enabled: true
|
89
|
-
|
96
|
+
Lint/SymbolConversion: # new in 1.9
|
90
97
|
Enabled: true
|
91
|
-
|
92
|
-
Gemspec/RequireMFA: # new in 1.23
|
98
|
+
Lint/ToEnumArguments: # new in 1.1
|
93
99
|
Enabled: true
|
94
|
-
Lint/
|
100
|
+
Lint/TripleQuotes: # new in 1.9
|
95
101
|
Enabled: true
|
96
|
-
Lint/
|
102
|
+
Lint/UnexpectedBlockArity: # new in 1.5
|
97
103
|
Enabled: true
|
98
|
-
Lint/
|
104
|
+
Lint/UnmodifiedReduceAccumulator: # new in 1.1
|
99
105
|
Enabled: true
|
100
|
-
Lint/
|
106
|
+
Lint/UselessRescue: # new in 1.43
|
101
107
|
Enabled: true
|
102
108
|
Lint/UselessRuby2Keywords: # new in 1.23
|
103
109
|
Enabled: true
|
110
|
+
Metrics/CollectionLiteralLength: # new in 1.47
|
111
|
+
Enabled: true
|
104
112
|
Naming/BlockForwarding: # new in 1.24
|
105
113
|
Enabled: true
|
114
|
+
Security/CompoundHash: # new in 1.28
|
115
|
+
Enabled: true
|
106
116
|
Security/IoMethods: # new in 1.22
|
107
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
|
108
146
|
Style/FileRead: # new in 1.24
|
109
147
|
Enabled: true
|
110
148
|
Style/FileWrite: # new in 1.24
|
111
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
|
112
162
|
Style/MapToHash: # new in 1.24
|
113
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
|
114
176
|
Style/NumberedParameters: # new in 1.22
|
115
177
|
Enabled: true
|
116
178
|
Style/NumberedParametersLimit: # new in 1.22
|
117
179
|
Enabled: true
|
180
|
+
Style/ObjectThen: # new in 1.28
|
181
|
+
Enabled: true
|
118
182
|
Style/OpenStructUse: # new in 1.23
|
119
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
|
120
212
|
Style/RedundantSelfAssignmentBranch: # new in 1.19
|
121
213
|
Enabled: true
|
214
|
+
Style/RedundantStringEscape: # new in 1.37
|
215
|
+
Enabled: true
|
216
|
+
Style/ReturnNilInPredicateMethodDefinition: # new in 1.53
|
217
|
+
Enabled: true
|
122
218
|
Style/SelectByRegexp: # new in 1.22
|
123
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
|
+
RSpec/BeEmpty: # new in 2.20
|
231
|
+
Enabled: true
|
232
|
+
RSpec/BeEq: # new in 2.9.0
|
233
|
+
Enabled: true
|
234
|
+
RSpec/BeNil: # new in 2.9.0
|
235
|
+
Enabled: true
|
236
|
+
RSpec/ChangeByZero: # new in 2.11
|
237
|
+
Enabled: true
|
238
|
+
RSpec/ContainExactly: # new in 2.19
|
239
|
+
Enabled: true
|
240
|
+
RSpec/DuplicatedMetadata: # new in 2.16
|
241
|
+
Enabled: true
|
242
|
+
RSpec/EmptyMetadata: # new in 2.24
|
243
|
+
Enabled: true
|
244
|
+
RSpec/Eq: # new in 2.24
|
245
|
+
Enabled: true
|
246
|
+
RSpec/ExcessiveDocstringSpacing: # new in 2.5
|
247
|
+
Enabled: true
|
248
|
+
RSpec/IdenticalEqualityAssertion: # new in 2.4
|
249
|
+
Enabled: true
|
250
|
+
RSpec/IndexedLet: # new in 2.20
|
251
|
+
Enabled: true
|
252
|
+
RSpec/MatchArray: # new in 2.19
|
253
|
+
Enabled: true
|
254
|
+
RSpec/MetadataStyle: # new in 2.24
|
255
|
+
Enabled: true
|
256
|
+
RSpec/NoExpectationExample: # new in 2.13
|
257
|
+
Enabled: true
|
258
|
+
RSpec/PendingWithoutReason: # new in 2.16
|
259
|
+
Enabled: true
|
260
|
+
RSpec/ReceiveMessages: # new in 2.23
|
261
|
+
Enabled: true
|
262
|
+
RSpec/RedundantAround: # new in 2.19
|
263
|
+
Enabled: true
|
264
|
+
RSpec/RedundantPredicateMatcher: # new in 2.26
|
265
|
+
Enabled: true
|
266
|
+
RSpec/RemoveConst: # new in 2.26
|
267
|
+
Enabled: true
|
268
|
+
RSpec/SkipBlockInsideExample: # new in 2.19
|
269
|
+
Enabled: true
|
270
|
+
RSpec/SortMetadata: # new in 2.14
|
271
|
+
Enabled: true
|
272
|
+
RSpec/SpecFilePathFormat: # new in 2.24
|
273
|
+
Enabled: true
|
274
|
+
RSpec/SpecFilePathSuffix: # new in 2.24
|
275
|
+
Enabled: true
|
276
|
+
RSpec/SubjectDeclaration: # new in 2.5
|
277
|
+
Enabled: true
|
278
|
+
RSpec/VerifiedDoubleReference: # new in 2.10.0
|
279
|
+
Enabled: true
|
280
|
+
Gemspec/AddRuntimeDependency: # new in 1.65
|
281
|
+
Enabled: true
|
282
|
+
Lint/ArrayLiteralInRegexp: # new in 1.71
|
283
|
+
Enabled: true
|
284
|
+
Lint/ConstantReassignment: # new in 1.70
|
285
|
+
Enabled: true
|
286
|
+
Lint/CopDirectiveSyntax: # new in 1.72
|
287
|
+
Enabled: true
|
288
|
+
Lint/DuplicateSetElement: # new in 1.67
|
289
|
+
Enabled: true
|
290
|
+
Lint/HashNewWithKeywordArgumentsAsDefault: # new in 1.69
|
291
|
+
Enabled: true
|
292
|
+
Lint/NumericOperationWithConstantResult: # new in 1.69
|
293
|
+
Enabled: true
|
294
|
+
Lint/RedundantTypeConversion: # new in 1.72
|
295
|
+
Enabled: true
|
296
|
+
Lint/SharedMutableDefault: # new in 1.70
|
297
|
+
Enabled: true
|
298
|
+
Lint/SuppressedExceptionInNumberConversion: # new in 1.72
|
299
|
+
Enabled: true
|
300
|
+
Lint/UnescapedBracketInRegexp: # new in 1.68
|
301
|
+
Enabled: true
|
302
|
+
Lint/UselessConstantScoping: # new in 1.72
|
303
|
+
Enabled: true
|
304
|
+
Lint/UselessDefined: # new in 1.69
|
305
|
+
Enabled: true
|
306
|
+
Lint/UselessNumericOperation: # new in 1.66
|
307
|
+
Enabled: true
|
308
|
+
Style/AmbiguousEndlessMethodDefinition: # new in 1.68
|
309
|
+
Enabled: true
|
310
|
+
Style/BitwisePredicate: # new in 1.68
|
311
|
+
Enabled: true
|
312
|
+
Style/CombinableDefined: # new in 1.68
|
313
|
+
Enabled: true
|
314
|
+
Style/DigChain: # new in 1.69
|
315
|
+
Enabled: true
|
316
|
+
Style/FileNull: # new in 1.69
|
317
|
+
Enabled: true
|
318
|
+
Style/FileTouch: # new in 1.69
|
319
|
+
Enabled: true
|
320
|
+
Style/HashSlice: # new in 1.71
|
321
|
+
Enabled: true
|
322
|
+
Style/ItAssignment: # new in 1.70
|
323
|
+
Enabled: true
|
324
|
+
Style/KeywordArgumentsMerging: # new in 1.68
|
325
|
+
Enabled: true
|
326
|
+
Style/MapIntoArray: # new in 1.63
|
327
|
+
Enabled: true
|
328
|
+
Style/RedundantFormat: # new in 1.72
|
329
|
+
Enabled: true
|
330
|
+
Style/RedundantInterpolationUnfreeze: # new in 1.66
|
331
|
+
Enabled: true
|
332
|
+
Style/SafeNavigationChainLength: # new in 1.68
|
333
|
+
Enabled: true
|
334
|
+
Style/SendWithLiteralMethodName: # new in 1.64
|
335
|
+
Enabled: true
|
336
|
+
Style/SuperArguments: # new in 1.64
|
337
|
+
Enabled: true
|
data/Gemfile
CHANGED
@@ -5,14 +5,13 @@ 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
|
-
gem "rubocop-
|
15
|
-
gem "
|
16
|
-
|
17
|
-
gem "byebug"
|
14
|
+
gem "rubocop-rake"
|
15
|
+
gem "rubocop-rspec"
|
16
|
+
gem "simplecov"
|
18
17
|
gem "webmock", "~> 3.13"
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
datacite (0.
|
4
|
+
datacite (0.5.0)
|
5
5
|
dry-monads (~> 1.3)
|
6
6
|
faraday (~> 2.0)
|
7
7
|
json_schema (~> 0.21.0)
|
@@ -10,84 +10,120 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
addressable (2.8.
|
14
|
-
public_suffix (>= 2.0.2, <
|
15
|
-
ast (2.4.
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
addressable (2.8.7)
|
14
|
+
public_suffix (>= 2.0.2, < 7.0)
|
15
|
+
ast (2.4.3)
|
16
|
+
base64 (0.2.0)
|
17
|
+
bigdecimal (3.1.9)
|
18
|
+
byebug (12.0.0)
|
19
|
+
concurrent-ruby (1.3.5)
|
20
|
+
crack (1.0.0)
|
21
|
+
bigdecimal
|
19
22
|
rexml
|
20
|
-
diff-lcs (1.
|
21
|
-
|
23
|
+
diff-lcs (1.6.1)
|
24
|
+
docile (1.4.1)
|
25
|
+
dry-core (1.1.0)
|
22
26
|
concurrent-ruby (~> 1.0)
|
23
|
-
|
27
|
+
logger
|
28
|
+
zeitwerk (~> 2.6)
|
29
|
+
dry-monads (1.8.3)
|
24
30
|
concurrent-ruby (~> 1.0)
|
25
|
-
dry-core (~>
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
+
dry-core (~> 1.1)
|
32
|
+
zeitwerk (~> 2.6)
|
33
|
+
faraday (2.13.1)
|
34
|
+
faraday-net_http (>= 2.0, < 3.5)
|
35
|
+
json
|
36
|
+
logger
|
37
|
+
faraday-net_http (3.4.0)
|
38
|
+
net-http (>= 0.5.0)
|
39
|
+
hashdiff (1.1.2)
|
40
|
+
json (2.11.3)
|
31
41
|
json_schema (0.21.0)
|
32
|
-
|
33
|
-
|
42
|
+
language_server-protocol (3.17.0.4)
|
43
|
+
lint_roller (1.1.0)
|
44
|
+
logger (1.7.0)
|
45
|
+
net-http (0.6.0)
|
46
|
+
uri
|
47
|
+
parallel (1.27.0)
|
48
|
+
parser (3.3.8.0)
|
34
49
|
ast (~> 2.4.1)
|
35
|
-
|
50
|
+
racc
|
51
|
+
prism (1.4.0)
|
52
|
+
public_suffix (6.0.1)
|
53
|
+
racc (1.8.1)
|
36
54
|
rainbow (3.1.1)
|
37
|
-
rake (13.
|
38
|
-
regexp_parser (2.
|
39
|
-
rexml (3.
|
40
|
-
rspec (3.
|
41
|
-
rspec-core (~> 3.
|
42
|
-
rspec-expectations (~> 3.
|
43
|
-
rspec-mocks (~> 3.
|
44
|
-
rspec-core (3.
|
45
|
-
rspec-support (~> 3.
|
46
|
-
rspec-expectations (3.
|
55
|
+
rake (13.2.1)
|
56
|
+
regexp_parser (2.10.0)
|
57
|
+
rexml (3.4.1)
|
58
|
+
rspec (3.13.0)
|
59
|
+
rspec-core (~> 3.13.0)
|
60
|
+
rspec-expectations (~> 3.13.0)
|
61
|
+
rspec-mocks (~> 3.13.0)
|
62
|
+
rspec-core (3.13.3)
|
63
|
+
rspec-support (~> 3.13.0)
|
64
|
+
rspec-expectations (3.13.3)
|
47
65
|
diff-lcs (>= 1.2.0, < 2.0)
|
48
|
-
rspec-support (~> 3.
|
49
|
-
rspec-mocks (3.
|
66
|
+
rspec-support (~> 3.13.0)
|
67
|
+
rspec-mocks (3.13.2)
|
50
68
|
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
-
rspec-support (~> 3.
|
52
|
-
rspec-support (3.
|
53
|
-
rubocop (1.
|
69
|
+
rspec-support (~> 3.13.0)
|
70
|
+
rspec-support (3.13.2)
|
71
|
+
rubocop (1.75.3)
|
72
|
+
json (~> 2.3)
|
73
|
+
language_server-protocol (~> 3.17.0.2)
|
74
|
+
lint_roller (~> 1.1.0)
|
54
75
|
parallel (~> 1.10)
|
55
|
-
parser (>= 3.
|
76
|
+
parser (>= 3.3.0.2)
|
56
77
|
rainbow (>= 2.2.2, < 4.0)
|
57
|
-
regexp_parser (>=
|
58
|
-
|
59
|
-
rubocop-ast (>= 1.15.1, < 2.0)
|
78
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
79
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
60
80
|
ruby-progressbar (~> 1.7)
|
61
|
-
unicode-display_width (>=
|
62
|
-
rubocop-ast (1.
|
63
|
-
parser (>= 3.
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
rubocop (
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
81
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
82
|
+
rubocop-ast (1.44.1)
|
83
|
+
parser (>= 3.3.7.2)
|
84
|
+
prism (~> 1.4)
|
85
|
+
rubocop-rake (0.7.1)
|
86
|
+
lint_roller (~> 1.1)
|
87
|
+
rubocop (>= 1.72.1)
|
88
|
+
rubocop-rspec (3.6.0)
|
89
|
+
lint_roller (~> 1.1)
|
90
|
+
rubocop (~> 1.72, >= 1.72.1)
|
91
|
+
ruby-progressbar (1.13.0)
|
92
|
+
simplecov (0.22.0)
|
93
|
+
docile (~> 1.1)
|
94
|
+
simplecov-html (~> 0.11)
|
95
|
+
simplecov_json_formatter (~> 0.1)
|
96
|
+
simplecov-html (0.13.1)
|
97
|
+
simplecov_json_formatter (0.1.4)
|
98
|
+
unicode-display_width (3.1.4)
|
99
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
100
|
+
unicode-emoji (4.0.4)
|
101
|
+
uri (1.0.3)
|
102
|
+
webmock (3.25.1)
|
72
103
|
addressable (>= 2.8.0)
|
73
104
|
crack (>= 0.3.2)
|
74
105
|
hashdiff (>= 0.4.0, < 2.0.0)
|
75
|
-
zeitwerk (2.
|
106
|
+
zeitwerk (2.7.2)
|
76
107
|
|
77
108
|
PLATFORMS
|
109
|
+
arm64-darwin-23
|
110
|
+
arm64-darwin-24
|
78
111
|
x86_64-darwin-19
|
79
112
|
x86_64-darwin-21
|
113
|
+
x86_64-darwin-22
|
80
114
|
x86_64-linux
|
81
115
|
|
82
116
|
DEPENDENCIES
|
117
|
+
base64
|
83
118
|
byebug
|
84
119
|
datacite!
|
85
120
|
rake (~> 13.0)
|
86
121
|
rspec (~> 3.0)
|
87
122
|
rubocop (~> 1.7)
|
88
|
-
rubocop-rake
|
89
|
-
rubocop-rspec
|
123
|
+
rubocop-rake
|
124
|
+
rubocop-rspec
|
125
|
+
simplecov
|
90
126
|
webmock (~> 3.13)
|
91
127
|
|
92
128
|
BUNDLED WITH
|
93
|
-
2.
|
129
|
+
2.6.8
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
# Datacite Ruby Client
|
2
|
-
|
3
1
|
[](https://badge.fury.io/rb/datacite)
|
2
|
+
[](https://circleci.com/gh/sul-dlss/datacite-ruby)
|
3
|
+
[](https://codecov.io/github/sul-dlss/datacite-ruby)
|
4
|
+
|
5
|
+
# Datacite Ruby Client
|
4
6
|
|
5
7
|
This is a Ruby client for interfacing with the DataCite REST API. https://support.datacite.org/docs/api
|
6
8
|
|
@@ -35,7 +37,7 @@ client = Datacite::Client.new(username: "foo",
|
|
35
37
|
result = client.register_doi(prefix: '10.0001', suffix: 'bc123df4567')
|
36
38
|
|
37
39
|
result.either(
|
38
|
-
-> response { response
|
40
|
+
-> response { response },
|
39
41
|
-> response { raise("Something went wrong", response.status) }
|
40
42
|
)
|
41
43
|
```
|
@@ -73,6 +75,28 @@ result.either(
|
|
73
75
|
)
|
74
76
|
```
|
75
77
|
|
78
|
+
### Determine if a DOI exists
|
79
|
+
|
80
|
+
```ruby
|
81
|
+
result = client.exists?(id: '10.0001/bc123df4567')
|
82
|
+
|
83
|
+
result.either(
|
84
|
+
-> response { response },
|
85
|
+
-> response { raise("Something went wrong", response.status) }
|
86
|
+
)
|
87
|
+
```
|
88
|
+
|
89
|
+
### Get metadata for a DOI
|
90
|
+
|
91
|
+
```ruby
|
92
|
+
result = client.metadata(id: '10.0001/bc123df4567')
|
93
|
+
|
94
|
+
result.either(
|
95
|
+
-> response { response },
|
96
|
+
-> response { raise("Something went wrong", response.status) }
|
97
|
+
)
|
98
|
+
```
|
99
|
+
|
76
100
|
### Validation
|
77
101
|
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
102
|
|
@@ -80,6 +104,7 @@ We've made the following changes:
|
|
80
104
|
* relax the required fields (https://github.com/datacite/schema/issues/97)
|
81
105
|
* add event property (https://github.com/datacite/schema/issues/100)
|
82
106
|
* add url property (https://github.com/datacite/schema/issues/101)
|
107
|
+
* add xml property to support Datacite 4.4 xml schema via the api (https://github.com/datacite/schema/issues/99)
|
83
108
|
|
84
109
|
## Development
|
85
110
|
|
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 = ">=
|
14
|
+
spec.required_ruby_version = ">= 3.0"
|
15
15
|
|
16
16
|
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
17
17
|
|
data/lib/datacite/client.rb
CHANGED
@@ -12,13 +12,13 @@ module Datacite
|
|
12
12
|
# @param [String] username
|
13
13
|
# @param [String] password
|
14
14
|
# @param [String] host
|
15
|
-
def initialize(username
|
15
|
+
def initialize(username: nil, password: nil, host: "api.test.datacite.org")
|
16
16
|
@conn = Faraday.new(
|
17
17
|
url: "https://#{host}",
|
18
18
|
headers: headers
|
19
19
|
) do |conn|
|
20
20
|
conn.request :json
|
21
|
-
conn.request :authorization, :basic, username, password
|
21
|
+
conn.request :authorization, :basic, username, password if username
|
22
22
|
conn.response :json
|
23
23
|
end
|
24
24
|
end
|
@@ -56,6 +56,33 @@ module Datacite
|
|
56
56
|
response.success? ? Success(Response.new(response)) : Failure(response)
|
57
57
|
end
|
58
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
|
+
|
74
|
+
# Fetches the metadata for a DOI
|
75
|
+
# @param [String] id
|
76
|
+
# @returns [Dry::Monads::Result(Hash)]
|
77
|
+
def metadata(id:)
|
78
|
+
response = conn.get("/dois/#{id}")
|
79
|
+
if response.success?
|
80
|
+
Success(response.body)
|
81
|
+
else
|
82
|
+
Failure(response)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
59
86
|
private
|
60
87
|
|
61
88
|
# @returns [Dry::Monads::Result]
|
data/lib/datacite/schema.json
CHANGED
data/lib/datacite/version.rb
CHANGED
data/lib/datacite.rb
CHANGED
@@ -2,11 +2,7 @@
|
|
2
2
|
|
3
3
|
require "zeitwerk"
|
4
4
|
|
5
|
-
|
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.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-monads
|
@@ -73,8 +73,8 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
+
- ".circleci/config.yml"
|
76
77
|
- ".github/pull_request_template.md"
|
77
|
-
- ".github/workflows/main.yml"
|
78
78
|
- ".gitignore"
|
79
79
|
- ".rspec"
|
80
80
|
- ".rubocop.yml"
|
@@ -108,14 +108,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
108
108
|
requirements:
|
109
109
|
- - ">="
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version:
|
111
|
+
version: '3.0'
|
112
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - ">="
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
|
-
rubygems_version: 3.
|
118
|
+
rubygems_version: 3.5.11
|
119
119
|
signing_key:
|
120
120
|
specification_version: 4
|
121
121
|
summary: A Ruby client library for the DataCite REST API
|
data/.github/workflows/main.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
name: Ruby
|
2
|
-
|
3
|
-
on: [push,pull_request]
|
4
|
-
|
5
|
-
jobs:
|
6
|
-
build:
|
7
|
-
runs-on: ubuntu-latest
|
8
|
-
steps:
|
9
|
-
- uses: actions/checkout@v2
|
10
|
-
- name: Set up Ruby
|
11
|
-
uses: ruby/setup-ruby@v1
|
12
|
-
with:
|
13
|
-
ruby-version: 2.7.2
|
14
|
-
bundler-cache: true
|
15
|
-
- name: Run the default task
|
16
|
-
run: bundle exec rake
|