commonmeta-ruby 3.5 → 3.5.2

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: eff7462ec031d3c8ad11d8f684738711c0464cee5644028d8d805ff36f09058f
4
- data.tar.gz: 8fda70b594d569ffe432f6071c85f9009d8e83434bd3f079a6ea7d312e57f3bd
3
+ metadata.gz: 8045d5f8042da41baf35bc82800bc689db433c16fc6f3607c980aac18d409022
4
+ data.tar.gz: 578ae0ae2c0a8addf955e859d821312c1ca0951e8d9e4b542a6cf55c53055e8e
5
5
  SHA512:
6
- metadata.gz: 69b5c2c59cb28d2d4615ec21c10f760efa504aa1c33fda841327900f61367a71e1a51accce0a5c643fd2b4bd066ebaf34e67a616de01a147bc1140f3fed8f442
7
- data.tar.gz: 005a9c7e7b1fee2e452d6683e9952cbf778817cb19c0a62fa1b83f805e22ba435e1f64bfcfb1e217aec2c1112ea83cb9321f3f1a743d478161fe1a100f65a9c8
6
+ metadata.gz: e39aba0b9e648e4b3880f5883955fe3af49710062e259ccc278a4e170f964a16271a9cf22cbbaa9fdcbb39183aafee71c4aa88284f93667288d619029ae49fcb
7
+ data.tar.gz: b3399a055354e06a990089880c228113cf6db476d4717954ffc053ed42fdbc16669a97327d420b2ecf6b014e79c7191aef0082de75b649170c76a30df58bb490
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- commonmeta-ruby (3.5)
4
+ commonmeta-ruby (3.5.2)
5
5
  activesupport (>= 4.2.5, < 8.0)
6
6
  addressable (~> 2.8.1, < 2.8.2)
7
7
  base32-url (>= 0.7.0, < 1)
@@ -27,7 +27,7 @@ PATH
27
27
  GEM
28
28
  remote: https://rubygems.org/
29
29
  specs:
30
- activesupport (7.0.7.2)
30
+ activesupport (7.0.8)
31
31
  concurrent-ruby (~> 1.0, >= 1.0.2)
32
32
  i18n (>= 1.6, < 2)
33
33
  minitest (>= 5.1)
@@ -147,7 +147,7 @@ GEM
147
147
  rack (>= 1.3)
148
148
  rainbow (3.1.1)
149
149
  rake (13.0.6)
150
- rdf (3.3.0)
150
+ rdf (3.3.1)
151
151
  bcp47_spec (~> 0.2)
152
152
  link_header (~> 0.0, >= 0.0.8)
153
153
  rdf-rdfxml (3.3.0)
@@ -179,7 +179,7 @@ GEM
179
179
  rspec-xsd (0.1.0)
180
180
  nokogiri (~> 1.6)
181
181
  rspec (~> 3)
182
- rubocop (1.56.2)
182
+ rubocop (1.56.3)
183
183
  base64 (~> 0.1.1)
184
184
  json (~> 2.3)
185
185
  language_server-protocol (>= 3.17.0)
@@ -193,11 +193,11 @@ GEM
193
193
  unicode-display_width (>= 2.4.0, < 3.0)
194
194
  rubocop-ast (1.29.0)
195
195
  parser (>= 3.2.1.0)
196
- rubocop-capybara (2.18.0)
196
+ rubocop-capybara (2.19.0)
197
197
  rubocop (~> 1.41)
198
- rubocop-factory_bot (2.23.1)
198
+ rubocop-factory_bot (2.24.0)
199
199
  rubocop (~> 1.33)
200
- rubocop-performance (1.19.0)
200
+ rubocop-performance (1.19.1)
201
201
  rubocop (>= 1.7.0, < 2.0)
202
202
  rubocop-ast (>= 0.4.0)
203
203
  rubocop-rake (0.6.0)
data/csl-data.json ADDED
@@ -0,0 +1,538 @@
1
+ {
2
+ "description": "JSON schema for CSL input data",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "$id": "https://resource.citationstyles.org/schema/v1.0/input/json/csl-data.json",
5
+ "type": "array",
6
+ "items": {
7
+ "type": "object",
8
+ "properties": {
9
+ "type": {
10
+ "type": "string",
11
+ "enum": [
12
+ "article",
13
+ "article-journal",
14
+ "article-magazine",
15
+ "article-newspaper",
16
+ "bill",
17
+ "book",
18
+ "broadcast",
19
+ "chapter",
20
+ "classic",
21
+ "collection",
22
+ "dataset",
23
+ "document",
24
+ "entry",
25
+ "entry-dictionary",
26
+ "entry-encyclopedia",
27
+ "event",
28
+ "figure",
29
+ "graphic",
30
+ "hearing",
31
+ "interview",
32
+ "legal_case",
33
+ "legislation",
34
+ "manuscript",
35
+ "map",
36
+ "motion_picture",
37
+ "musical_score",
38
+ "pamphlet",
39
+ "paper-conference",
40
+ "patent",
41
+ "performance",
42
+ "periodical",
43
+ "personal_communication",
44
+ "post",
45
+ "post-weblog",
46
+ "regulation",
47
+ "report",
48
+ "review",
49
+ "review-book",
50
+ "software",
51
+ "song",
52
+ "speech",
53
+ "standard",
54
+ "thesis",
55
+ "treaty",
56
+ "webpage"
57
+ ]
58
+ },
59
+ "id": {
60
+ "type": ["string", "number"]
61
+ },
62
+ "citation-key": {
63
+ "type": "string"
64
+ },
65
+ "categories": {
66
+ "type": "array",
67
+ "items": {
68
+ "type": "string"
69
+ }
70
+ },
71
+ "language": {
72
+ "type": "string"
73
+ },
74
+ "journalAbbreviation": {
75
+ "type": "string"
76
+ },
77
+ "shortTitle": {
78
+ "type": "string"
79
+ },
80
+ "author": {
81
+ "type": "array",
82
+ "items": {
83
+ "$ref": "#/definitions/name-variable"
84
+ }
85
+ },
86
+ "chair": {
87
+ "type": "array",
88
+ "items": {
89
+ "$ref": "#/definitions/name-variable"
90
+ }
91
+ },
92
+ "collection-editor": {
93
+ "type": "array",
94
+ "items": {
95
+ "$ref": "#/definitions/name-variable"
96
+ }
97
+ },
98
+ "compiler": {
99
+ "type": "array",
100
+ "items": {
101
+ "$ref": "#/definitions/name-variable"
102
+ }
103
+ },
104
+ "composer": {
105
+ "type": "array",
106
+ "items": {
107
+ "$ref": "#/definitions/name-variable"
108
+ }
109
+ },
110
+ "container-author": {
111
+ "type": "array",
112
+ "items": {
113
+ "$ref": "#/definitions/name-variable"
114
+ }
115
+ },
116
+ "contributor": {
117
+ "type": "array",
118
+ "items": {
119
+ "$ref": "#/definitions/name-variable"
120
+ }
121
+ },
122
+ "curator": {
123
+ "type": "array",
124
+ "items": {
125
+ "$ref": "#/definitions/name-variable"
126
+ }
127
+ },
128
+ "director": {
129
+ "type": "array",
130
+ "items": {
131
+ "$ref": "#/definitions/name-variable"
132
+ }
133
+ },
134
+ "editor": {
135
+ "type": "array",
136
+ "items": {
137
+ "$ref": "#/definitions/name-variable"
138
+ }
139
+ },
140
+ "editorial-director": {
141
+ "type": "array",
142
+ "items": {
143
+ "$ref": "#/definitions/name-variable"
144
+ }
145
+ },
146
+ "executive-producer": {
147
+ "type": "array",
148
+ "items": {
149
+ "$ref": "#/definitions/name-variable"
150
+ }
151
+ },
152
+ "guest": {
153
+ "type": "array",
154
+ "items": {
155
+ "$ref": "#/definitions/name-variable"
156
+ }
157
+ },
158
+ "host": {
159
+ "type": "array",
160
+ "items": {
161
+ "$ref": "#/definitions/name-variable"
162
+ }
163
+ },
164
+ "interviewer": {
165
+ "type": "array",
166
+ "items": {
167
+ "$ref": "#/definitions/name-variable"
168
+ }
169
+ },
170
+ "illustrator": {
171
+ "type": "array",
172
+ "items": {
173
+ "$ref": "#/definitions/name-variable"
174
+ }
175
+ },
176
+ "narrator": {
177
+ "type": "array",
178
+ "items": {
179
+ "$ref": "#/definitions/name-variable"
180
+ }
181
+ },
182
+ "organizer": {
183
+ "type": "array",
184
+ "items": {
185
+ "$ref": "#/definitions/name-variable"
186
+ }
187
+ },
188
+ "original-author": {
189
+ "type": "array",
190
+ "items": {
191
+ "$ref": "#/definitions/name-variable"
192
+ }
193
+ },
194
+ "performer": {
195
+ "type": "array",
196
+ "items": {
197
+ "$ref": "#/definitions/name-variable"
198
+ }
199
+ },
200
+ "producer": {
201
+ "type": "array",
202
+ "items": {
203
+ "$ref": "#/definitions/name-variable"
204
+ }
205
+ },
206
+ "recipient": {
207
+ "type": "array",
208
+ "items": {
209
+ "$ref": "#/definitions/name-variable"
210
+ }
211
+ },
212
+ "reviewed-author": {
213
+ "type": "array",
214
+ "items": {
215
+ "$ref": "#/definitions/name-variable"
216
+ }
217
+ },
218
+ "script-writer": {
219
+ "type": "array",
220
+ "items": {
221
+ "$ref": "#/definitions/name-variable"
222
+ }
223
+ },
224
+ "series-creator": {
225
+ "type": "array",
226
+ "items": {
227
+ "$ref": "#/definitions/name-variable"
228
+ }
229
+ },
230
+ "translator": {
231
+ "type": "array",
232
+ "items": {
233
+ "$ref": "#/definitions/name-variable"
234
+ }
235
+ },
236
+ "accessed": {
237
+ "$ref": "#/definitions/date-variable"
238
+ },
239
+ "available-date": {
240
+ "$ref": "#/definitions/date-variable"
241
+ },
242
+ "event-date": {
243
+ "$ref": "#/definitions/date-variable"
244
+ },
245
+ "issued": {
246
+ "$ref": "#/definitions/date-variable"
247
+ },
248
+ "original-date": {
249
+ "$ref": "#/definitions/date-variable"
250
+ },
251
+ "submitted": {
252
+ "$ref": "#/definitions/date-variable"
253
+ },
254
+ "abstract": {
255
+ "type": "string"
256
+ },
257
+ "annote": {
258
+ "type": "string"
259
+ },
260
+ "archive": {
261
+ "type": "string"
262
+ },
263
+ "archive_collection": {
264
+ "type": "string"
265
+ },
266
+ "archive_location": {
267
+ "type": "string"
268
+ },
269
+ "archive-place": {
270
+ "type": "string"
271
+ },
272
+ "authority": {
273
+ "type": "string"
274
+ },
275
+ "call-number": {
276
+ "type": "string"
277
+ },
278
+ "chapter-number": {
279
+ "type": ["string", "number"]
280
+ },
281
+ "citation-number": {
282
+ "type": ["string", "number"]
283
+ },
284
+ "citation-label": {
285
+ "type": "string"
286
+ },
287
+ "collection-number": {
288
+ "type": ["string", "number"]
289
+ },
290
+ "collection-title": {
291
+ "type": "string"
292
+ },
293
+ "container-title": {
294
+ "type": "string"
295
+ },
296
+ "container-title-short": {
297
+ "type": "string"
298
+ },
299
+ "dimensions": {
300
+ "type": "string"
301
+ },
302
+ "division": {
303
+ "type": "string"
304
+ },
305
+ "DOI": {
306
+ "type": "string"
307
+ },
308
+ "edition": {
309
+ "type": ["string", "number"]
310
+ },
311
+ "event": {
312
+ "description": "[Deprecated - use 'event-title' instead. Will be removed in 1.1]",
313
+ "type": "string"
314
+ },
315
+ "event-title": {
316
+ "type": "string"
317
+ },
318
+ "event-place": {
319
+ "type": "string"
320
+ },
321
+ "first-reference-note-number": {
322
+ "type": ["string", "number"]
323
+ },
324
+ "genre": {
325
+ "type": "string"
326
+ },
327
+ "ISBN": {
328
+ "type": "string"
329
+ },
330
+ "ISSN": {
331
+ "type": "string"
332
+ },
333
+ "issue": {
334
+ "type": ["string", "number"]
335
+ },
336
+ "jurisdiction": {
337
+ "type": "string"
338
+ },
339
+ "keyword": {
340
+ "type": "string"
341
+ },
342
+ "locator": {
343
+ "type": ["string", "number"]
344
+ },
345
+ "medium": {
346
+ "type": "string"
347
+ },
348
+ "note": {
349
+ "type": "string"
350
+ },
351
+ "number": {
352
+ "type": ["string", "number"]
353
+ },
354
+ "number-of-pages": {
355
+ "type": ["string", "number"]
356
+ },
357
+ "number-of-volumes": {
358
+ "type": ["string", "number"]
359
+ },
360
+ "original-publisher": {
361
+ "type": "string"
362
+ },
363
+ "original-publisher-place": {
364
+ "type": "string"
365
+ },
366
+ "original-title": {
367
+ "type": "string"
368
+ },
369
+ "page": {
370
+ "type": ["string", "number"]
371
+ },
372
+ "page-first": {
373
+ "type": ["string", "number"]
374
+ },
375
+ "part": {
376
+ "type": ["string", "number"]
377
+ },
378
+ "part-title": {
379
+ "type": "string"
380
+ },
381
+ "PMCID": {
382
+ "type": "string"
383
+ },
384
+ "PMID": {
385
+ "type": "string"
386
+ },
387
+ "printing": {
388
+ "type": ["string", "number"]
389
+ },
390
+ "publisher": {
391
+ "type": "string"
392
+ },
393
+ "publisher-place": {
394
+ "type": "string"
395
+ },
396
+ "references": {
397
+ "type": "string"
398
+ },
399
+ "reviewed-genre": {
400
+ "type": "string"
401
+ },
402
+ "reviewed-title": {
403
+ "type": "string"
404
+ },
405
+ "scale": {
406
+ "type": "string"
407
+ },
408
+ "section": {
409
+ "type": "string"
410
+ },
411
+ "source": {
412
+ "type": "string"
413
+ },
414
+ "status": {
415
+ "type": "string"
416
+ },
417
+ "supplement": {
418
+ "type": ["string", "number"]
419
+ },
420
+ "title": {
421
+ "type": "string"
422
+ },
423
+ "title-short": {
424
+ "type": "string"
425
+ },
426
+ "URL": {
427
+ "type": "string"
428
+ },
429
+ "version": {
430
+ "type": "string"
431
+ },
432
+ "volume": {
433
+ "type": ["string", "number"]
434
+ },
435
+ "volume-title": {
436
+ "type": "string"
437
+ },
438
+ "volume-title-short": {
439
+ "type": "string"
440
+ },
441
+ "year-suffix": {
442
+ "type": "string"
443
+ },
444
+ "custom": {
445
+ "title": "Custom key-value pairs.",
446
+ "type": "object",
447
+ "description": "Used to store additional information that does not have a designated CSL JSON field. The custom field is preferred over the note field for storing custom data, particularly for storing key-value pairs, as the note field is used for user annotations in annotated bibliography styles.",
448
+ "examples": [
449
+ {
450
+ "short_id": "xyz",
451
+ "other-ids": ["alternative-id"]
452
+ },
453
+ {
454
+ "metadata-double-checked": true
455
+ }
456
+ ]
457
+ }
458
+ },
459
+ "required": ["type", "id"],
460
+ "additionalProperties": false
461
+ },
462
+ "definitions": {
463
+ "name-variable": {
464
+ "anyOf": [
465
+ {
466
+ "type": "object",
467
+ "properties": {
468
+ "family": {
469
+ "type": "string"
470
+ },
471
+ "given": {
472
+ "type": "string"
473
+ },
474
+ "dropping-particle": {
475
+ "type": "string"
476
+ },
477
+ "non-dropping-particle": {
478
+ "type": "string"
479
+ },
480
+ "suffix": {
481
+ "type": "string"
482
+ },
483
+ "comma-suffix": {
484
+ "type": ["string", "number", "boolean"]
485
+ },
486
+ "static-ordering": {
487
+ "type": ["string", "number", "boolean"]
488
+ },
489
+ "literal": {
490
+ "type": "string"
491
+ },
492
+ "parse-names": {
493
+ "type": ["string", "number", "boolean"]
494
+ }
495
+ },
496
+ "additionalProperties": false
497
+ }
498
+ ]
499
+ },
500
+ "date-variable": {
501
+ "title": "Date content model.",
502
+ "description": "The CSL input model supports two different date representations: an EDTF string (preferred), and a more structured alternative.",
503
+ "anyOf": [
504
+ {
505
+ "type": "object",
506
+ "properties": {
507
+ "date-parts": {
508
+ "type": "array",
509
+ "items": {
510
+ "type": "array",
511
+ "items": {
512
+ "type": ["string", "number"]
513
+ },
514
+ "minItems": 1,
515
+ "maxItems": 3
516
+ },
517
+ "minItems": 1,
518
+ "maxItems": 2
519
+ },
520
+ "season": {
521
+ "type": ["string", "number"]
522
+ },
523
+ "circa": {
524
+ "type": ["string", "number", "boolean"]
525
+ },
526
+ "literal": {
527
+ "type": "string"
528
+ },
529
+ "raw": {
530
+ "type": "string"
531
+ }
532
+ },
533
+ "additionalProperties": false
534
+ }
535
+ ]
536
+ }
537
+ }
538
+ }
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: true
1
+ # frozen_string_literal: truefiles
2
2
 
3
3
  require_relative 'metadata_utils'
4
4
 
@@ -10,7 +10,7 @@ module Commonmeta
10
10
  :email, :registrant
11
11
  attr_reader :doc, :page_start, :page_end
12
12
  attr_writer :id, :provider_id, :client_id, :doi, :alternate_identifiers, :contributors,
13
- :titles, :publisher, :license, :date, :volume, :url, :version, :subjects, :descriptions, :language, :sizes, :formats, :schema_version, :meta, :container, :provider, :format, :funding_references, :state, :geo_locations, :type, :additional_type, :content_url, :references, :related_identifiers, :related_items, :style, :locale
13
+ :titles, :publisher, :license, :date, :volume, :url, :version, :subjects, :descriptions, :language, :sizes, :formats, :schema_version, :meta, :container, :provider, :format, :funding_references, :state, :geo_locations, :type, :additional_type, :files, :references, :related_identifiers, :related_items, :style, :locale
14
14
 
15
15
  def initialize(options = {})
16
16
  options.symbolize_keys!
@@ -45,7 +45,7 @@ module Commonmeta
45
45
  'state' => options[:state],
46
46
  'provider_id' => options[:provider_id],
47
47
  'client_id' => options[:client_id],
48
- 'content_url' => options[:content_url]
48
+ 'files' => options[:files]
49
49
  }
50
50
  string = File.read(options[:input])
51
51
  @from = options[:from] || find_from_format(string: string, ext: ext)
@@ -59,7 +59,7 @@ module Commonmeta
59
59
  'state' => options[:state],
60
60
  'provider_id' => options[:provider_id],
61
61
  'client_id' => options[:client_id],
62
- 'content_url' => options[:content_url],
62
+ 'files' => options[:files],
63
63
  'contributors' => options[:contributors],
64
64
  'titles' => options[:titles],
65
65
  'publisher' => options[:publisher]
@@ -85,7 +85,7 @@ module Commonmeta
85
85
  @state = hsh.to_h['state'].presence
86
86
  @provider_id = hsh.to_h['provider_id'].presence
87
87
  @client_id = hsh.to_h['client_id'].presence
88
- @content_url = hsh.to_h['content_url'].presence
88
+ @files = hsh.to_h['files'].presence
89
89
 
90
90
  # options that come from the cli, needed
91
91
  # for crossref doi registration
@@ -226,8 +226,8 @@ module Commonmeta
226
226
  @alternate_identifiers ||= meta.fetch('alternate_identifiers', nil)
227
227
  end
228
228
 
229
- def content_url
230
- @content_url ||= meta.fetch('content_url', nil)
229
+ def files
230
+ @files ||= meta.fetch('files', nil)
231
231
  end
232
232
 
233
233
  def provider