datacite 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1fee1923d00de9ba8043c40dc887b9de41337fb393e7571698898ea1d33cb5fd
4
- data.tar.gz: db4544ce1ff24888c0c1f918cc423bca0b187f5d6486d2125cb5b48dee451a67
3
+ metadata.gz: 8c402c810fe15ec361ab43cc1d16eb828cf20996453c0c1ef6ebe9c37a843eb3
4
+ data.tar.gz: 77b49fcbb192cf95d5ede1eb4718fa1fa200c57b4a40f2780e19052bbdd96e09
5
5
  SHA512:
6
- metadata.gz: 8cfcc7da219fde13da7a1766957dfb1c1271b55a3398ef350eb34b5c18905989a3972005c5545a5b78fa682137c1d68ab2f219b6198ee2e93f26952a791fa6d9
7
- data.tar.gz: 501cc5e985beea3c78df3b281f75abf9371c703bbd190aba5c350cbe883929ca8592a882e22b3d0317174d64e360c67d062982673741aeb4f5f41d3cf78ff080
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 # dor-service-app is < 3.0 due to fedora3
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,299 @@ Style/StringLiteralsInInterpolation:
16
27
  Layout/LineLength:
17
28
  Max: 120
18
29
 
19
- Gemspec/DateAssignment: # (new in 1.10)
20
- Enabled: true
21
- Layout/LineEndStringConcatenationIndentation: # (new in 1.18)
30
+ Gemspec/DeprecatedAttributeAssignment: # new in 1.30
22
31
  Enabled: true
23
- Layout/SpaceBeforeBrackets: # (new in 1.7)
32
+ Gemspec/DevelopmentDependencies: # new in 1.44
24
33
  Enabled: true
25
- Lint/AmbiguousAssignment: # (new in 1.7)
34
+ Gemspec/RequireMFA: # new in 1.23
26
35
  Enabled: true
27
- Lint/DeprecatedConstants: # (new in 1.8)
36
+ Layout/LineContinuationLeadingSpace: # new in 1.31
28
37
  Enabled: true
29
- Lint/DuplicateBranch: # (new in 1.3)
38
+ Layout/LineContinuationSpacing: # new in 1.31
30
39
  Enabled: true
31
- Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
40
+ Layout/LineEndStringConcatenationIndentation: # new in 1.18
32
41
  Enabled: true
33
- Lint/EmptyBlock: # (new in 1.1)
42
+ Layout/SpaceBeforeBrackets: # new in 1.7
34
43
  Enabled: true
35
- Lint/EmptyClass: # (new in 1.3)
44
+ Lint/AmbiguousAssignment: # new in 1.7
36
45
  Enabled: true
37
- Lint/EmptyInPattern: # (new in 1.16)
46
+ Lint/AmbiguousOperatorPrecedence: # new in 1.21
38
47
  Enabled: true
39
- Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
48
+ Lint/AmbiguousRange: # new in 1.19
40
49
  Enabled: true
41
- Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
50
+ Lint/ConstantOverwrittenInRescue: # new in 1.31
42
51
  Enabled: true
43
- Lint/NumberedParameterAssignment: # (new in 1.9)
52
+ Lint/DeprecatedConstants: # new in 1.8
44
53
  Enabled: true
45
- Lint/OrAssignmentToConstant: # (new in 1.9)
54
+ Lint/DuplicateBranch: # new in 1.3
46
55
  Enabled: true
47
- Lint/RedundantDirGlobSort: # (new in 1.8)
56
+ Lint/DuplicateMagicComment: # new in 1.37
48
57
  Enabled: true
49
- Lint/SymbolConversion: # (new in 1.9)
58
+ Lint/DuplicateMatchPattern: # new in 1.50
50
59
  Enabled: true
51
- Lint/ToEnumArguments: # (new in 1.1)
60
+ Lint/DuplicateRegexpCharacterClassElement: # new in 1.1
52
61
  Enabled: true
53
- Lint/TripleQuotes: # (new in 1.9)
62
+ Lint/EmptyBlock: # new in 1.1
54
63
  Enabled: true
55
- Lint/UnexpectedBlockArity: # (new in 1.5)
64
+ Lint/EmptyClass: # new in 1.3
56
65
  Enabled: true
57
- Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
66
+ Lint/EmptyInPattern: # new in 1.16
58
67
  Enabled: true
59
- Naming/InclusiveLanguage: # (new in 1.18)
68
+ Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
60
69
  Enabled: true
61
- Style/ArgumentsForwarding: # (new in 1.1)
70
+ Lint/ItWithoutArgumentsInBlock: # new in 1.59
62
71
  Enabled: true
63
- Style/CollectionCompact: # (new in 1.2)
72
+ Lint/LambdaWithoutLiteralBlock: # new in 1.8
64
73
  Enabled: true
65
- Style/DocumentDynamicEvalDefinition: # (new in 1.1)
74
+ Lint/LiteralAssignmentInCondition: # new in 1.58
66
75
  Enabled: true
67
- Style/EndlessMethod: # (new in 1.8)
76
+ Lint/MixedCaseRange: # new in 1.53
68
77
  Enabled: true
69
- Style/HashConversion: # (new in 1.10)
78
+ Lint/NoReturnInBeginEndBlocks: # new in 1.2
70
79
  Enabled: true
71
- Style/HashExcept: # (new in 1.7)
80
+ Lint/NonAtomicFileOperation: # new in 1.31
72
81
  Enabled: true
73
- Style/IfWithBooleanLiteralBranches: # (new in 1.9)
82
+ Lint/NumberedParameterAssignment: # new in 1.9
74
83
  Enabled: true
75
- Style/InPatternThen: # (new in 1.16)
84
+ Lint/OrAssignmentToConstant: # new in 1.9
76
85
  Enabled: true
77
- Style/MultilineInPatternThen: # (new in 1.16)
86
+ Lint/RedundantDirGlobSort: # new in 1.8
78
87
  Enabled: true
79
- Style/NegatedIfElseCondition: # (new in 1.2)
88
+ Lint/RedundantRegexpQuantifiers: # new in 1.53
80
89
  Enabled: true
81
- Style/NilLambda: # (new in 1.3)
90
+ Lint/RefinementImportMethods: # new in 1.27
82
91
  Enabled: true
83
- Style/QuotedSymbols: # (new in 1.16)
92
+ Lint/RequireRangeParentheses: # new in 1.32
84
93
  Enabled: true
85
- Style/RedundantArgument: # (new in 1.4)
94
+ Lint/RequireRelativeSelfPath: # new in 1.22
86
95
  Enabled: true
87
- Style/StringChars: # (new in 1.12)
96
+ Lint/SymbolConversion: # new in 1.9
88
97
  Enabled: true
89
- Style/SwapValues: # (new in 1.1)
98
+ Lint/ToEnumArguments: # new in 1.1
90
99
  Enabled: true
91
-
92
- Gemspec/RequireMFA: # new in 1.23
100
+ Lint/TripleQuotes: # new in 1.9
93
101
  Enabled: true
94
- Lint/AmbiguousOperatorPrecedence: # new in 1.21
102
+ Lint/UnexpectedBlockArity: # new in 1.5
95
103
  Enabled: true
96
- Lint/AmbiguousRange: # new in 1.19
104
+ Lint/UnmodifiedReduceAccumulator: # new in 1.1
97
105
  Enabled: true
98
- Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
99
- Enabled: true
100
- Lint/RequireRelativeSelfPath: # new in 1.22
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
+ 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
255
+ Enabled: true
256
+ FactoryBot/FactoryNameStyle: # new in 2.16
257
+ Enabled: true
258
+ FactoryBot/IdSequence: # new in 2.24
259
+ Enabled: true
260
+ FactoryBot/RedundantFactoryOption: # new in 2.23
261
+ Enabled: true
262
+ FactoryBot/SyntaxMethods: # new in 2.7
263
+ Enabled: true
264
+ RSpec/BeEmpty: # new in 2.20
265
+ Enabled: true
266
+ RSpec/BeEq: # new in 2.9.0
267
+ Enabled: true
268
+ RSpec/BeNil: # new in 2.9.0
269
+ Enabled: true
270
+ RSpec/ChangeByZero: # new in 2.11
271
+ Enabled: true
272
+ RSpec/ContainExactly: # new in 2.19
273
+ Enabled: true
274
+ RSpec/DuplicatedMetadata: # new in 2.16
275
+ Enabled: true
276
+ RSpec/EmptyMetadata: # new in 2.24
277
+ Enabled: true
278
+ RSpec/Eq: # new in 2.24
279
+ Enabled: true
280
+ RSpec/ExcessiveDocstringSpacing: # new in 2.5
281
+ Enabled: true
282
+ RSpec/IdenticalEqualityAssertion: # new in 2.4
283
+ Enabled: true
284
+ RSpec/IndexedLet: # new in 2.20
285
+ Enabled: true
286
+ RSpec/MatchArray: # new in 2.19
287
+ Enabled: true
288
+ RSpec/MetadataStyle: # new in 2.24
289
+ Enabled: true
290
+ RSpec/NoExpectationExample: # new in 2.13
291
+ Enabled: true
292
+ RSpec/PendingWithoutReason: # new in 2.16
293
+ Enabled: true
294
+ RSpec/ReceiveMessages: # new in 2.23
295
+ Enabled: true
296
+ RSpec/RedundantAround: # new in 2.19
297
+ Enabled: true
298
+ RSpec/RedundantPredicateMatcher: # new in 2.26
299
+ Enabled: true
300
+ RSpec/RemoveConst: # new in 2.26
301
+ Enabled: true
302
+ RSpec/SkipBlockInsideExample: # new in 2.19
303
+ Enabled: true
304
+ RSpec/SortMetadata: # new in 2.14
305
+ Enabled: true
306
+ RSpec/SpecFilePathFormat: # new in 2.24
307
+ Enabled: true
308
+ RSpec/SpecFilePathSuffix: # new in 2.24
309
+ Enabled: true
310
+ RSpec/SubjectDeclaration: # new in 2.5
311
+ Enabled: true
312
+ RSpec/VerifiedDoubleReference: # new in 2.10.0
313
+ Enabled: true
314
+ RSpec/Rails/AvoidSetupHook: # new in 2.4
315
+ Enabled: true
316
+ RSpec/Rails/HaveHttpStatus: # new in 2.12
317
+ Enabled: true
318
+ RSpec/Rails/InferredSpecType: # new in 2.14
319
+ Enabled: true
320
+ RSpec/Rails/MinitestAssertions: # new in 2.17
321
+ Enabled: true
322
+ RSpec/Rails/NegationBeValid: # new in 2.23
323
+ Enabled: true
324
+ RSpec/Rails/TravelAround: # new in 2.19
325
+ Enabled: true
data/Gemfile CHANGED
@@ -5,14 +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
- gem "byebug"
18
16
  gem "webmock", "~> 3.13"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- datacite (0.3.0)
4
+ datacite (0.4.0)
5
5
  dry-monads (~> 1.3)
6
6
  faraday (~> 2.0)
7
7
  json_schema (~> 0.21.0)
@@ -10,76 +10,107 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- addressable (2.8.0)
14
- public_suffix (>= 2.0.2, < 5.0)
13
+ addressable (2.8.7)
14
+ public_suffix (>= 2.0.2, < 7.0)
15
15
  ast (2.4.2)
16
+ base64 (0.2.0)
17
+ bigdecimal (3.1.9)
16
18
  byebug (11.1.3)
17
- concurrent-ruby (1.1.9)
18
- crack (0.4.5)
19
+ concurrent-ruby (1.3.4)
20
+ crack (1.0.0)
21
+ bigdecimal
19
22
  rexml
20
- diff-lcs (1.5.0)
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 (2.2.0)
27
- faraday-net_http (~> 2.0)
28
- ruby2_keywords (>= 0.0.4)
29
- faraday-net_http (2.0.1)
30
- 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)
31
40
  json_schema (0.21.0)
32
- parallel (1.21.0)
33
- parser (3.1.1.0)
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)
34
47
  ast (~> 2.4.1)
35
- public_suffix (4.0.6)
48
+ racc
49
+ public_suffix (6.0.1)
50
+ racc (1.8.1)
36
51
  rainbow (3.1.1)
37
- rake (13.0.6)
38
- regexp_parser (2.2.1)
39
- rexml (3.2.5)
40
- rspec (3.11.0)
41
- rspec-core (~> 3.11.0)
42
- rspec-expectations (~> 3.11.0)
43
- rspec-mocks (~> 3.11.0)
44
- rspec-core (3.11.0)
45
- rspec-support (~> 3.11.0)
46
- rspec-expectations (3.11.0)
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)
47
62
  diff-lcs (>= 1.2.0, < 2.0)
48
- rspec-support (~> 3.11.0)
49
- rspec-mocks (3.11.0)
63
+ rspec-support (~> 3.13.0)
64
+ rspec-mocks (3.13.2)
50
65
  diff-lcs (>= 1.2.0, < 2.0)
51
- rspec-support (~> 3.11.0)
52
- rspec-support (3.11.0)
53
- rubocop (1.25.1)
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)
54
71
  parallel (~> 1.10)
55
- parser (>= 3.1.0.0)
72
+ parser (>= 3.3.0.2)
56
73
  rainbow (>= 2.2.2, < 4.0)
57
- regexp_parser (>= 1.8, < 3.0)
58
- rexml
59
- rubocop-ast (>= 1.15.1, < 2.0)
74
+ regexp_parser (>= 2.9.3, < 3.0)
75
+ rubocop-ast (>= 1.36.2, < 2.0)
60
76
  ruby-progressbar (~> 1.7)
61
- unicode-display_width (>= 1.4.0, < 3.0)
62
- rubocop-ast (1.16.0)
63
- parser (>= 3.1.1.0)
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)
64
84
  rubocop-rake (0.6.0)
65
85
  rubocop (~> 1.0)
66
- rubocop-rspec (2.9.0)
67
- rubocop (~> 1.19)
68
- ruby-progressbar (1.11.0)
69
- ruby2_keywords (0.0.5)
70
- unicode-display_width (2.1.0)
71
- webmock (3.14.0)
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)
72
99
  addressable (>= 2.8.0)
73
100
  crack (>= 0.3.2)
74
101
  hashdiff (>= 0.4.0, < 2.0.0)
75
- zeitwerk (2.5.4)
102
+ zeitwerk (2.7.1)
76
103
 
77
104
  PLATFORMS
105
+ arm64-darwin-23
106
+ arm64-darwin-24
78
107
  x86_64-darwin-19
79
108
  x86_64-darwin-21
109
+ x86_64-darwin-22
80
110
  x86_64-linux
81
111
 
82
112
  DEPENDENCIES
113
+ base64
83
114
  byebug
84
115
  datacite!
85
116
  rake (~> 13.0)
@@ -90,4 +121,4 @@ DEPENDENCIES
90
121
  webmock (~> 3.13)
91
122
 
92
123
  BUNDLED WITH
93
- 2.3.4
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
 
@@ -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:, password:, host: "api.test.datacite.org")
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,21 @@ 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
+
59
74
  private
60
75
 
61
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.3.0"
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.3.0
4
+ version: 0.4.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: 2022-03-01 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
@@ -108,14 +108,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - ">="
110
110
  - !ruby/object:Gem::Version
111
- version: 2.7.0
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.2.32
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