ocfl 0.4.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +158 -3
- data/README.md +8 -2
- data/lib/ocfl/object/directory.rb +13 -12
- data/lib/ocfl/object/directory_builder.rb +25 -16
- data/lib/ocfl/object/draft_version.rb +15 -13
- data/lib/ocfl/object/inventory.rb +9 -4
- data/lib/ocfl/object/inventory_validator.rb +2 -5
- data/lib/ocfl/object/inventory_writer.rb +2 -5
- data/lib/ocfl/object/version.rb +4 -0
- data/lib/ocfl/object.rb +3 -1
- data/lib/ocfl/version.rb +1 -1
- data/lib/ocfl.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b32346d0bd14e71b28385a1e34ad4f4af73335ab64345fa374c890ccf07e4f83
|
4
|
+
data.tar.gz: 4f9f6bc929cdee4f24e3b8b4bca167d69219d34fb74de00ff75414a68ee66ad2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9a520d6bf056649a3b4c261ea27fb6d5a994d8f0bd274f5a8aca19751e24fa4c1ca08de57ee7971b927081f4dcb941a514570deba8088580579613123a1d1f1
|
7
|
+
data.tar.gz: a3df7b8ae6913eee74a0bea12474ee4c7ebe937bd1b92c28c8918e2a00c46d82191e99a360dacd780b1be65f1bdab25dbca7edfa47f3d03b8d4cf8e3ef534ebe
|
data/.rubocop.yml
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
- rubocop-rake
|
4
|
+
- rubocop-rspec
|
5
|
+
|
1
6
|
AllCops:
|
2
7
|
TargetRubyVersion: 3.1
|
3
8
|
|
@@ -17,8 +22,14 @@ Metrics/BlockLength:
|
|
17
22
|
- describe
|
18
23
|
- context
|
19
24
|
|
20
|
-
|
21
|
-
Enabled: false
|
25
|
+
RSpec/MultipleExpectations:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
RSpec/ExampleLength:
|
29
|
+
Max: 10
|
30
|
+
|
31
|
+
RSpec/NestedGroups:
|
32
|
+
Max: 4
|
22
33
|
|
23
34
|
Gemspec/DeprecatedAttributeAssignment: # new in 1.30
|
24
35
|
Enabled: true
|
@@ -219,4 +230,148 @@ Style/SuperWithArgsParentheses: # new in 1.58
|
|
219
230
|
Style/SwapValues: # new in 1.1
|
220
231
|
Enabled: true
|
221
232
|
Style/YAMLFileRead: # new in 1.53
|
222
|
-
Enabled: true
|
233
|
+
Enabled: true
|
234
|
+
Style/MapIntoArray: # new in 1.63
|
235
|
+
Enabled: true
|
236
|
+
Performance/AncestorsInclude: # new in 1.7
|
237
|
+
Enabled: true
|
238
|
+
Performance/BigDecimalWithNumericArgument: # new in 1.7
|
239
|
+
Enabled: true
|
240
|
+
Performance/BlockGivenWithExplicitBlock: # new in 1.9
|
241
|
+
Enabled: true
|
242
|
+
Performance/CollectionLiteralInLoop: # new in 1.8
|
243
|
+
Enabled: true
|
244
|
+
Performance/ConcurrentMonotonicTime: # new in 1.12
|
245
|
+
Enabled: true
|
246
|
+
Performance/ConstantRegexp: # new in 1.9
|
247
|
+
Enabled: true
|
248
|
+
Performance/MapCompact: # new in 1.11
|
249
|
+
Enabled: true
|
250
|
+
Performance/MapMethodChain: # new in 1.19
|
251
|
+
Enabled: true
|
252
|
+
Performance/MethodObjectAsBlock: # new in 1.9
|
253
|
+
Enabled: true
|
254
|
+
Performance/RedundantEqualityComparisonBlock: # new in 1.10
|
255
|
+
Enabled: true
|
256
|
+
Performance/RedundantSortBlock: # new in 1.7
|
257
|
+
Enabled: true
|
258
|
+
Performance/RedundantSplitRegexpArgument: # new in 1.10
|
259
|
+
Enabled: true
|
260
|
+
Performance/RedundantStringChars: # new in 1.7
|
261
|
+
Enabled: true
|
262
|
+
Performance/ReverseFirst: # new in 1.7
|
263
|
+
Enabled: true
|
264
|
+
Performance/SortReverse: # new in 1.7
|
265
|
+
Enabled: true
|
266
|
+
Performance/Squeeze: # new in 1.7
|
267
|
+
Enabled: true
|
268
|
+
Performance/StringIdentifierArgument: # new in 1.13
|
269
|
+
Enabled: true
|
270
|
+
Performance/StringInclude: # new in 1.7
|
271
|
+
Enabled: true
|
272
|
+
Performance/Sum: # new in 1.8
|
273
|
+
Enabled: true
|
274
|
+
Capybara/ClickLinkOrButtonStyle: # new in 2.19
|
275
|
+
Enabled: true
|
276
|
+
Capybara/MatchStyle: # new in 2.17
|
277
|
+
Enabled: true
|
278
|
+
Capybara/NegationMatcher: # new in 2.14
|
279
|
+
Enabled: true
|
280
|
+
Capybara/RedundantWithinFind: # new in 2.20
|
281
|
+
Enabled: true
|
282
|
+
Capybara/SpecificActions: # new in 2.14
|
283
|
+
Enabled: true
|
284
|
+
Capybara/SpecificFinders: # new in 2.13
|
285
|
+
Enabled: true
|
286
|
+
Capybara/SpecificMatcher: # new in 2.12
|
287
|
+
Enabled: true
|
288
|
+
Capybara/RSpec/HaveSelector: # new in 2.19
|
289
|
+
Enabled: true
|
290
|
+
Capybara/RSpec/PredicateMatcher: # new in 2.19
|
291
|
+
Enabled: true
|
292
|
+
FactoryBot/AssociationStyle: # new in 2.23
|
293
|
+
Enabled: true
|
294
|
+
FactoryBot/ConsistentParenthesesStyle: # new in 2.14
|
295
|
+
Enabled: true
|
296
|
+
FactoryBot/ExcessiveCreateList: # new in 2.25
|
297
|
+
Enabled: true
|
298
|
+
FactoryBot/FactoryAssociationWithStrategy: # new in 2.23
|
299
|
+
Enabled: true
|
300
|
+
FactoryBot/FactoryNameStyle: # new in 2.16
|
301
|
+
Enabled: true
|
302
|
+
FactoryBot/IdSequence: # new in 2.24
|
303
|
+
Enabled: true
|
304
|
+
FactoryBot/RedundantFactoryOption: # new in 2.23
|
305
|
+
Enabled: true
|
306
|
+
FactoryBot/SyntaxMethods: # new in 2.7
|
307
|
+
Enabled: true
|
308
|
+
RSpecRails/AvoidSetupHook: # new in 2.4
|
309
|
+
Enabled: true
|
310
|
+
RSpecRails/HaveHttpStatus: # new in 2.12
|
311
|
+
Enabled: true
|
312
|
+
RSpecRails/InferredSpecType: # new in 2.14
|
313
|
+
Enabled: true
|
314
|
+
RSpecRails/MinitestAssertions: # new in 2.17
|
315
|
+
Enabled: true
|
316
|
+
RSpecRails/NegationBeValid: # new in 2.23
|
317
|
+
Enabled: true
|
318
|
+
RSpecRails/TravelAround: # new in 2.19
|
319
|
+
Enabled: true
|
320
|
+
RSpec/BeEmpty: # new in 2.20
|
321
|
+
Enabled: true
|
322
|
+
RSpec/BeEq: # new in 2.9.0
|
323
|
+
Enabled: true
|
324
|
+
RSpec/BeNil: # new in 2.9.0
|
325
|
+
Enabled: true
|
326
|
+
RSpec/ChangeByZero: # new in 2.11
|
327
|
+
Enabled: true
|
328
|
+
RSpec/ContainExactly: # new in 2.19
|
329
|
+
Enabled: true
|
330
|
+
RSpec/DuplicatedMetadata: # new in 2.16
|
331
|
+
Enabled: true
|
332
|
+
RSpec/EmptyMetadata: # new in 2.24
|
333
|
+
Enabled: true
|
334
|
+
RSpec/EmptyOutput: # new in 2.29
|
335
|
+
Enabled: true
|
336
|
+
RSpec/Eq: # new in 2.24
|
337
|
+
Enabled: true
|
338
|
+
RSpec/ExcessiveDocstringSpacing: # new in 2.5
|
339
|
+
Enabled: true
|
340
|
+
RSpec/IdenticalEqualityAssertion: # new in 2.4
|
341
|
+
Enabled: true
|
342
|
+
RSpec/IndexedLet: # new in 2.20
|
343
|
+
Enabled: true
|
344
|
+
RSpec/IsExpectedSpecify: # new in 2.27
|
345
|
+
Enabled: true
|
346
|
+
RSpec/MatchArray: # new in 2.19
|
347
|
+
Enabled: true
|
348
|
+
RSpec/MetadataStyle: # new in 2.24
|
349
|
+
Enabled: true
|
350
|
+
RSpec/NoExpectationExample: # new in 2.13
|
351
|
+
Enabled: true
|
352
|
+
RSpec/PendingWithoutReason: # new in 2.16
|
353
|
+
Enabled: true
|
354
|
+
RSpec/ReceiveMessages: # new in 2.23
|
355
|
+
Enabled: true
|
356
|
+
RSpec/RedundantAround: # new in 2.19
|
357
|
+
Enabled: true
|
358
|
+
RSpec/RedundantPredicateMatcher: # new in 2.26
|
359
|
+
Enabled: true
|
360
|
+
RSpec/RemoveConst: # new in 2.26
|
361
|
+
Enabled: true
|
362
|
+
RSpec/RepeatedSubjectCall: # new in 2.27
|
363
|
+
Enabled: true
|
364
|
+
RSpec/SkipBlockInsideExample: # new in 2.19
|
365
|
+
Enabled: true
|
366
|
+
RSpec/SortMetadata: # new in 2.14
|
367
|
+
Enabled: true
|
368
|
+
RSpec/SpecFilePathFormat: # new in 2.24
|
369
|
+
Enabled: true
|
370
|
+
RSpec/SpecFilePathSuffix: # new in 2.24
|
371
|
+
Enabled: true
|
372
|
+
RSpec/SubjectDeclaration: # new in 2.5
|
373
|
+
Enabled: true
|
374
|
+
RSpec/UndescriptiveLiteralsDescription: # new in 2.29
|
375
|
+
Enabled: true
|
376
|
+
RSpec/VerifiedDoubleReference: # new in 2.10.0
|
377
|
+
Enabled: true
|
data/README.md
CHANGED
@@ -35,10 +35,16 @@ new_version.save
|
|
35
35
|
directory.head
|
36
36
|
# => 'v2'
|
37
37
|
|
38
|
-
|
38
|
+
# List file names that were part of a given version
|
39
|
+
directory.versions['v2'].file_names
|
40
|
+
# => ["ocfl.rbs"]
|
41
|
+
|
42
|
+
# Get the path of a file in a given version
|
43
|
+
directory.path(filepath: "ocfl.rbs", version: "v2")
|
39
44
|
# => <Pathname:/files/[object_root]/v2/content/ocfl.rbs>
|
40
45
|
|
41
|
-
|
46
|
+
# Get the path of a file in the head version
|
47
|
+
directory.path(filepath: "ocfl.rbs")
|
42
48
|
# => <Pathname:/files/[object_root]/v2/content/ocfl.rbs>
|
43
49
|
|
44
50
|
new_version = directory.overwrite_current_version
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "digest"
|
4
|
-
|
5
3
|
module OCFL
|
6
4
|
module Object
|
7
5
|
# An OCFL Directory layout for a particular object.
|
@@ -19,15 +17,18 @@ module OCFL
|
|
19
17
|
|
20
18
|
delegate :head, :versions, :manifest, to: :inventory
|
21
19
|
|
22
|
-
def path(version
|
23
|
-
version
|
24
|
-
relative_path = version_inventory(version).path(
|
25
|
-
|
20
|
+
def path(filepath:, version: nil)
|
21
|
+
version ||= head
|
22
|
+
relative_path = version_inventory(version).path(filepath)
|
23
|
+
|
24
|
+
raise FileNotFound, "Path '#{filepath}' not found in #{version} inventory" if relative_path.nil?
|
25
|
+
|
26
|
+
object_root / relative_path
|
26
27
|
end
|
27
28
|
|
28
29
|
def inventory
|
29
30
|
@inventory ||= begin
|
30
|
-
data = InventoryLoader.load(object_root
|
31
|
+
data = InventoryLoader.load(object_root / "inventory.json")
|
31
32
|
if data.success?
|
32
33
|
Inventory.new(data: data.value!)
|
33
34
|
else
|
@@ -44,7 +45,7 @@ module OCFL
|
|
44
45
|
|
45
46
|
def version_inventory(version)
|
46
47
|
@version_inventory[version] ||= begin
|
47
|
-
data = InventoryLoader.load(object_root
|
48
|
+
data = InventoryLoader.load(object_root / version / "inventory.json")
|
48
49
|
if data.success?
|
49
50
|
Inventory.new(data: data.value!)
|
50
51
|
else
|
@@ -60,10 +61,11 @@ module OCFL
|
|
60
61
|
@inventory = nil
|
61
62
|
@errors = nil
|
62
63
|
@version_inventory_errors = {}
|
64
|
+
true
|
63
65
|
end
|
64
66
|
|
65
67
|
def begin_new_version
|
66
|
-
DraftVersion.new(object_directory: self)
|
68
|
+
DraftVersion.new(object_directory: self, state: head_inventory.state)
|
67
69
|
end
|
68
70
|
|
69
71
|
def overwrite_current_version
|
@@ -82,7 +84,7 @@ module OCFL
|
|
82
84
|
end
|
83
85
|
|
84
86
|
def head_directory_valid?
|
85
|
-
InventoryValidator.new(directory: object_root
|
87
|
+
InventoryValidator.new(directory: object_root / inventory.head).valid? &&
|
86
88
|
!head_inventory.nil? # Ensures it could be loaded
|
87
89
|
end
|
88
90
|
|
@@ -91,9 +93,8 @@ module OCFL
|
|
91
93
|
end
|
92
94
|
|
93
95
|
def namaste_file
|
94
|
-
object_root
|
96
|
+
object_root / "0=ocfl_object_1.1"
|
95
97
|
end
|
96
98
|
end
|
97
|
-
# rubocop:enable Style/StringConcatenation
|
98
99
|
end
|
99
100
|
end
|
@@ -1,21 +1,25 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "digest"
|
4
|
-
|
5
3
|
module OCFL
|
6
4
|
module Object
|
7
5
|
# Creates a OCFL Directory layout for a particular object.
|
8
6
|
class DirectoryBuilder
|
9
7
|
class ObjectExists < Error; end
|
10
8
|
|
11
|
-
def initialize(object_root:, id:)
|
9
|
+
def initialize(object_root:, id:, content_directory: nil)
|
12
10
|
@object_root = Pathname.new(object_root)
|
13
11
|
raise ObjectExists, "The directory `#{object_root}' already exists" if @object_root.exist?
|
14
12
|
|
15
13
|
@id = id
|
14
|
+
inventory = Inventory.new(
|
15
|
+
data: Inventory::InventoryStruct.new(
|
16
|
+
new_inventory_attrs.tap { |attrs| attrs[:contentDirectory] = content_directory if content_directory }
|
17
|
+
)
|
18
|
+
)
|
19
|
+
@object_directory = Directory.new(object_root:, inventory:)
|
16
20
|
end
|
17
21
|
|
18
|
-
attr_reader :id, :object_root, :object_directory
|
22
|
+
attr_reader :id, :inventory, :object_root, :object_directory
|
19
23
|
|
20
24
|
def copy_file(...)
|
21
25
|
create_object_directory
|
@@ -33,28 +37,33 @@ module OCFL
|
|
33
37
|
|
34
38
|
# @return [Directory]
|
35
39
|
def save
|
36
|
-
|
37
|
-
FileUtils.
|
38
|
-
|
39
|
-
FileUtils.touch(object_root + "0=ocfl_object_1.1")
|
40
|
+
FileUtils.mkdir_p(object_root)
|
41
|
+
FileUtils.touch(object_directory.namaste_file)
|
40
42
|
write_inventory
|
41
43
|
object_directory
|
42
44
|
end
|
43
45
|
|
44
46
|
def version
|
45
|
-
@version ||=
|
46
|
-
data = Inventory::InventoryStruct.new(id:, version: "v0", type: Inventory::URI_1_1, digestAlgorithm: "sha512",
|
47
|
-
head: "v0", versions: {}, manifest: {})
|
48
|
-
inventory = Inventory.new(data:)
|
49
|
-
@object_directory = Directory.new(object_root: @object_root, inventory:)
|
50
|
-
DraftVersion.new(object_directory:)
|
51
|
-
end
|
47
|
+
@version ||= DraftVersion.new(object_directory:)
|
52
48
|
end
|
53
49
|
|
54
50
|
def write_inventory
|
55
51
|
version.save
|
56
52
|
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
def new_inventory_attrs
|
57
|
+
{
|
58
|
+
id:,
|
59
|
+
version: "v0",
|
60
|
+
type: Inventory::URI_1_1,
|
61
|
+
digestAlgorithm: "sha512",
|
62
|
+
head: "v0",
|
63
|
+
versions: {},
|
64
|
+
manifest: {}
|
65
|
+
}
|
66
|
+
end
|
57
67
|
end
|
58
|
-
# rubocop:enable Style/StringConcatenation
|
59
68
|
end
|
60
69
|
end
|
@@ -1,16 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "digest"
|
4
|
-
|
5
3
|
module OCFL
|
6
4
|
module Object
|
7
5
|
# A new OCFL version
|
8
6
|
class DraftVersion
|
9
7
|
# @params [Directory] object_directory
|
10
|
-
def initialize(object_directory:, overwrite_head: false)
|
8
|
+
def initialize(object_directory:, overwrite_head: false, state: {})
|
11
9
|
@object_directory = object_directory
|
12
10
|
@manifest = object_directory.inventory.manifest.dup
|
13
|
-
@state =
|
11
|
+
@state = state
|
14
12
|
|
15
13
|
number = object_directory.head.delete_prefix("v").to_i
|
16
14
|
@version_number = "v#{overwrite_head ? number : number + 1}"
|
@@ -40,27 +38,31 @@ module OCFL
|
|
40
38
|
end
|
41
39
|
|
42
40
|
def save
|
43
|
-
|
44
|
-
|
45
|
-
FileUtils.cp(path + "inventory.json", object_directory.object_root)
|
46
|
-
FileUtils.cp(path + "inventory.json.sha512", object_directory.object_root)
|
41
|
+
prepare_directory # only necessary if the version has no new content (deletes only)
|
42
|
+
write_inventory(build_inventory)
|
47
43
|
object_directory.reload
|
48
44
|
end
|
49
45
|
|
50
46
|
private
|
51
47
|
|
48
|
+
def write_inventory(inventory)
|
49
|
+
InventoryWriter.new(inventory:, path:).write
|
50
|
+
FileUtils.cp(path / "inventory.json", object_directory.object_root)
|
51
|
+
FileUtils.cp(path / "inventory.json.sha512", object_directory.object_root)
|
52
|
+
end
|
53
|
+
|
52
54
|
def copy_one(logical_file_path, incoming_path, destination_path)
|
53
55
|
logical_file_path = File.join(destination_path, logical_file_path) unless destination_path.empty?
|
54
56
|
add(incoming_path, logical_file_path:)
|
55
|
-
parent_dir = (content_path
|
57
|
+
parent_dir = (content_path / logical_file_path).parent
|
56
58
|
FileUtils.mkdir_p(parent_dir) unless parent_dir == content_path
|
57
|
-
FileUtils.cp(incoming_path, content_path
|
59
|
+
FileUtils.cp(incoming_path, content_path / logical_file_path)
|
58
60
|
end
|
59
61
|
|
60
62
|
def add(incoming_path, logical_file_path: File.basename(incoming_path))
|
61
63
|
digest = Digest::SHA512.file(incoming_path).to_s
|
62
64
|
version_content_path = content_path.relative_path_from(object_directory.object_root)
|
63
|
-
file_path_relative_to_root = (version_content_path
|
65
|
+
file_path_relative_to_root = (version_content_path / logical_file_path).to_s
|
64
66
|
@manifest[digest] = [file_path_relative_to_root]
|
65
67
|
@state[digest] = [logical_file_path]
|
66
68
|
end
|
@@ -81,11 +83,11 @@ module OCFL
|
|
81
83
|
end
|
82
84
|
|
83
85
|
def content_path
|
84
|
-
path
|
86
|
+
path / object_directory.inventory.content_directory
|
85
87
|
end
|
86
88
|
|
87
89
|
def path
|
88
|
-
object_directory.object_root
|
90
|
+
object_directory.object_root / version_number
|
89
91
|
end
|
90
92
|
|
91
93
|
def build_inventory
|
@@ -26,18 +26,23 @@ module OCFL
|
|
26
26
|
attr_reader :errors, :data
|
27
27
|
|
28
28
|
delegate :id, :head, :versions, :manifest, to: :data
|
29
|
+
delegate :state, to: :head_version
|
29
30
|
|
30
31
|
def content_directory
|
31
32
|
data.contentDirectory || "content"
|
32
33
|
end
|
33
34
|
|
34
|
-
# @
|
35
|
+
# @return [String,nil] the path to the file relative to the object root. (e.g. v2/content/image.tiff)
|
35
36
|
def path(logical_path)
|
36
|
-
|
37
|
+
digest, = state.find { |_, logical_paths| logical_paths.include?(logical_path) }
|
37
38
|
|
38
|
-
return unless
|
39
|
+
return unless digest
|
39
40
|
|
40
|
-
manifest.
|
41
|
+
manifest[digest].find { |content_path| content_path.match(%r{\Av\d+/#{content_directory}/#{logical_path}\z}) }
|
42
|
+
end
|
43
|
+
|
44
|
+
def head_version
|
45
|
+
versions[head]
|
41
46
|
end
|
42
47
|
end
|
43
48
|
end
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "digest"
|
4
|
-
|
5
3
|
module OCFL
|
6
4
|
module Object
|
7
5
|
# Checks to see that the inventory.json and it's checksum in a direcotory are valid
|
@@ -29,7 +27,7 @@ module OCFL
|
|
29
27
|
end
|
30
28
|
|
31
29
|
def inventory_checksum_file
|
32
|
-
directory
|
30
|
+
directory / "inventory.json.sha512"
|
33
31
|
end
|
34
32
|
|
35
33
|
def inventory_file_checksum
|
@@ -37,9 +35,8 @@ module OCFL
|
|
37
35
|
end
|
38
36
|
|
39
37
|
def inventory_file
|
40
|
-
directory
|
38
|
+
directory / "inventory.json"
|
41
39
|
end
|
42
40
|
end
|
43
|
-
# rubocop:enable Style/StringConcatenation
|
44
41
|
end
|
45
42
|
end
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "digest"
|
4
|
-
|
5
3
|
module OCFL
|
6
4
|
module Object
|
7
5
|
# Writes a OCFL Inventory to json on disk
|
@@ -23,11 +21,11 @@ module OCFL
|
|
23
21
|
end
|
24
22
|
|
25
23
|
def inventory_file
|
26
|
-
path
|
24
|
+
path / "inventory.json"
|
27
25
|
end
|
28
26
|
|
29
27
|
def checksum_file
|
30
|
-
path
|
28
|
+
path / "inventory.json.sha512"
|
31
29
|
end
|
32
30
|
|
33
31
|
def update_inventory_checksum
|
@@ -35,6 +33,5 @@ module OCFL
|
|
35
33
|
File.write(checksum_file, "#{digest} inventory.json")
|
36
34
|
end
|
37
35
|
end
|
38
|
-
# rubocop:enable Style/StringConcatenation
|
39
36
|
end
|
40
37
|
end
|
data/lib/ocfl/object/version.rb
CHANGED
data/lib/ocfl/object.rb
CHANGED
data/lib/ocfl/version.rb
CHANGED
data/lib/ocfl.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "zeitwerk"
|
4
|
-
require "
|
4
|
+
require "active_support"
|
5
|
+
require "active_support/core_ext/module/delegation"
|
6
|
+
require "digest"
|
5
7
|
require "dry/monads"
|
6
8
|
require "dry-schema"
|
7
9
|
require "dry-struct"
|
8
|
-
require "
|
9
|
-
require "active_support/core_ext/module/delegation"
|
10
|
+
require "json"
|
10
11
|
|
11
12
|
loader = Zeitwerk::Loader.for_gem
|
12
13
|
loader.inflector.inflect("ocfl" => "OCFL")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ocfl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.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: 2024-05-
|
11
|
+
date: 2024-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|