ocfl-tools 0.9.14

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.
data/results_codes.md ADDED
@@ -0,0 +1,106 @@
1
+
2
+ # Results codes DRAFT
3
+
4
+ ## OK
5
+
6
+ For times where you want to explicitly report success.
7
+
8
+ ```
9
+ O111 Placeholder code
10
+
11
+ O200 'OCFL 3.5.1 Inventory ID is OK.'
12
+ O200 'OCFL 3.5.1 Inventory Type is OK.'
13
+ O200 = <Inventory Value> is OK.
14
+ O200 'All discovered files in contentDirectory are referenced in inventory.'
15
+ O200 'All discovered files in contentDirectory match stored digest values.'
16
+ O200 'All digests successfully verified.'
17
+
18
+ ```
19
+
20
+ ## Informational
21
+
22
+ We're not passing judgement, we're just letting you know something neat.
23
+
24
+ ```
25
+ I111 Placeholder code
26
+ I101 "OCFL 3.3.1 version #{version} does not contain a contentDirectory."
27
+ I200 = <generic informational msg>
28
+ I220 "OCFL 3.5.1 #{@my_victim.digestAlgorithm.downcase} is a supported digest algorithm."
29
+ ```
30
+
31
+
32
+
33
+ ## Errors
34
+
35
+ Any error code means the resulting object has failed validation, and is not a valid OCFL object.
36
+
37
+ ```
38
+ E111 Placeholder code
39
+
40
+ E011 "OCFL 3.1 Version directory #{directory} contains files other than an inventory and inventory digest"
41
+ E012 "OCFL 3.1 Version directory #{directory} does not contain the contentDirectory specified in the inventory"
42
+ E013 "OCFL 3.1 Expected version directory #{directory} missing from directory list #{directories}"
43
+ E014 "OCFL 3.5.3 Found #{version_count} versions, but highest version is #{highest_version}"
44
+ E015 "OCFL 3.5.3 Expected version sequence not found. Expected version #{count}, found version #{my_versions[count]}."
45
+ E016 "OCFL 3.5.3.1 version #{version} is missing #{key} block."
46
+
47
+ E050 "OCFL 3.5.3.1 Digests missing! #{unique_checksums.length} digests in versions vs. #{@my_victim.manifest.length} digests in manifest."
48
+ E051 "OCFL 3.5.3.1 Checksum #{checksum} not found in manifest!"
49
+
50
+ E100 "Object root directory #{dir} is empty."
51
+ E101 "Object root contains noncompliant files: #{files}"
52
+ E102 "Object root does not include required file #{file}"
53
+ E103 'Object root does not include required NamAsTe file.'
54
+ E104 "Object root contains multiple NamAsTe files: #{files}"
55
+ E105 'Required NamAsTe file in object root directory has no content!'
56
+ E106 'Required NamAsTe file in object root directory does not contain expected string.'
57
+ E107 "Required NamAsTe file in object root is for unexpected OCFL version: #{ocfl_version}"
58
+
59
+ E200 'OCFL 3.5.1 Object ID not found'
60
+ E201 'OCFL 3.5.1 Object ID cannot be 0 length'
61
+ E202 'OCFL 3.5.1 Object ID cannot be nil'
62
+
63
+ E210 "Unable to read Inventory file #{inventory}."
64
+ E211 "OCFL 3.5 An OCFL Object Inventory must follow the [JSON] structure described in this section and must be named inventory.json."
65
+ E212 'OCFL 3.5.1 Inventory Head cannot be nil'
66
+ E213 'OCFL 3.5.1 Inventory Head cannot be an Integer'
67
+ E214 "OCFL 3.5.1 Inventory Head version #{version} does not match expected version #{target_version}"
68
+ E215 "OCFL 3.1 Expected inventory file #{file} not found."
69
+ E216 "OCFL 3.5.1 Expected key #{key} not found in inventory file #{file}"
70
+ E217 "OCFL 3.5.1 Expected key #{key} cannot be empty."
71
+
72
+ E220 Algorithm not found
73
+ E221 Algorithm cannot be 0 length
74
+ E222 Algorithm cannot be nil
75
+ E223 "OCFL 3.5.1 Algorithm #{digestAlgorithm} is not valid for OCFL use."
76
+
77
+ E230 'OCFL 3.5.1 Required OCFL key type not found.'
78
+ E231 'OCFL 3.5.1 Required OCFL key type does not match expected value.'
79
+
80
+ E250 'OCFL 3.5.2 there MUST be a manifest block.'
81
+ E251 'OCFL 3.5.2 manifest block cannot be empty.'
82
+
83
+ E260 "OCFL 3.5.3.1 logical path syntax error: #{error_details}"
84
+ E261 "OCFL 3.5.3.1 Version #{version} created block must be expressed in RFC3339 format."
85
+
86
+ E270 "OCFL 3.7 version state mismatch between inventory files: #{error_details}"
87
+
88
+ E911 'An unknown error has occurred.'
89
+ ```
90
+
91
+ ## Warnings
92
+
93
+ Issues that do not make the resulting object non-compliant, but are not ideal.
94
+
95
+ ```
96
+ W111 Placeholder code
97
+
98
+ W101 "OCFL 3.3 version directory should not contain any directories other than the designated content sub-directory. Additional directories found: #{version_dirs}"
99
+ W102 "OCFL 3.3.1 version #{version} contentDirectory should not be empty."
100
+ W201 'OCFL 3.5.1 Inventory ID present, but does not appear to be a URI.'
101
+ W220 "OCFL 3.5.1 #{@my_victim.digestAlgorithm.downcase} SHOULD be SHA512."
102
+ W270 "OCFL 3.7 version message mismatch between inventory files: #{warn_details}"
103
+ W271 "OCFL 3.7 version created mismatch between inventory files: #{warn_details}"
104
+ W272 "OCFL 3.7 version user mismatch between inventory files: #{warn_details}"
105
+
106
+ ```
data/test-it.sh ADDED
@@ -0,0 +1,11 @@
1
+ rspec spec/ocfl_object_spec.rb
2
+ rspec spec/ocfl_inventory_spec.rb
3
+ rspec spec/ocfl_checksums_spec.rb
4
+ # rspec spec/ocfl_deposit_spec.rb
5
+ rspec spec/ocfl_delta_spec.rb
6
+ rspec spec/ocfl_results_spec.rb
7
+ rspec spec/ocfl_verify_spec.rb
8
+ rspec spec/ocfl_validator_spec.rb
9
+
10
+
11
+ # rspec spec/ocfl_utils_file_spec.rb
metadata ADDED
@@ -0,0 +1,191 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ocfl-tools
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.14
5
+ platform: ruby
6
+ authors:
7
+ - Julian M. Morley
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-03-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: anyway_config
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: fileutils
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: json
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 2.2.0
48
+ - - "~>"
49
+ - !ruby/object:Gem::Version
50
+ version: '2.2'
51
+ type: :runtime
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: 2.2.0
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '2.2'
61
+ - !ruby/object:Gem::Dependency
62
+ name: pry-byebug
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rake
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: rspec
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ - !ruby/object:Gem::Dependency
104
+ name: rubocop
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ - !ruby/object:Gem::Dependency
118
+ name: rubocop-rspec
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ description: Tools to create, manipulate and write Oxford Common File Layout (OCFL)
132
+ preservation objects.
133
+ email:
134
+ - jmorley@stanford.edu
135
+ executables: []
136
+ extensions: []
137
+ extra_rdoc_files: []
138
+ files:
139
+ - ".gitignore"
140
+ - ".rubocop.yml"
141
+ - ".rubocop_todo.yml"
142
+ - ".travis.yml"
143
+ - Gemfile
144
+ - README.md
145
+ - Rakefile
146
+ - VERSION
147
+ - examples/list_files.rb
148
+ - examples/validate_object.rb
149
+ - lib/ocfl-tools.rb
150
+ - lib/ocfl_tools.rb
151
+ - lib/ocfl_tools/config.rb
152
+ - lib/ocfl_tools/ocfl_actions.rb
153
+ - lib/ocfl_tools/ocfl_delta.rb
154
+ - lib/ocfl_tools/ocfl_deposit.rb
155
+ - lib/ocfl_tools/ocfl_errors.rb
156
+ - lib/ocfl_tools/ocfl_inventory.rb
157
+ - lib/ocfl_tools/ocfl_object.rb
158
+ - lib/ocfl_tools/ocfl_results.rb
159
+ - lib/ocfl_tools/ocfl_validator.rb
160
+ - lib/ocfl_tools/ocfl_verify.rb
161
+ - lib/ocfl_tools/utils.rb
162
+ - lib/ocfl_tools/utils_file.rb
163
+ - lib/ocfl_tools/utils_inventory.rb
164
+ - ocfl-tools.gemspec
165
+ - results_codes.md
166
+ - test-it.sh
167
+ homepage: https://github.com/sul-dlss-labs/OCFL-Tools
168
+ licenses:
169
+ - Apache-2.0
170
+ metadata: {}
171
+ post_install_message:
172
+ rdoc_options: []
173
+ require_paths:
174
+ - lib
175
+ required_ruby_version: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ required_rubygems_version: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ version: '0'
185
+ requirements: []
186
+ rubygems_version: 3.0.3
187
+ signing_key:
188
+ specification_version: 4
189
+ summary: Tools to create, manipulate and write Oxford Common File Layout (OCFL) preservation
190
+ objects.
191
+ test_files: []