assembly-objectfile 1.8.2 → 1.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +30 -0
- data/.github/pull_request_template.md +12 -0
- data/.rubocop.yml +121 -6
- data/.rubocop_todo.yml +85 -55
- data/.travis.yml +3 -3
- data/Gemfile +2 -0
- data/README.md +2 -1
- data/Rakefile +2 -3
- data/assembly-objectfile.gemspec +9 -3
- data/config/boot.rb +4 -2
- data/lib/assembly-objectfile.rb +4 -21
- data/lib/assembly-objectfile/content_metadata.rb +53 -176
- data/lib/assembly-objectfile/content_metadata/config.rb +24 -0
- data/lib/assembly-objectfile/content_metadata/file.rb +63 -0
- data/lib/assembly-objectfile/content_metadata/file_set.rb +73 -0
- data/lib/assembly-objectfile/content_metadata/file_set_builder.rb +65 -0
- data/lib/assembly-objectfile/content_metadata/nokogiri_builder.rb +55 -0
- data/lib/assembly-objectfile/object_file.rb +5 -3
- data/lib/assembly-objectfile/object_fileable.rb +43 -19
- data/lib/assembly-objectfile/version.rb +3 -1
- data/spec/content_metadata_spec.rb +734 -568
- data/spec/object_file_spec.rb +14 -0
- data/spec/spec_helper.rb +6 -4
- metadata +75 -13
data/spec/object_file_spec.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Assembly::ObjectFile do
|
@@ -23,6 +25,8 @@ describe Assembly::ObjectFile do
|
|
23
25
|
expect(@ai.exif).not_to be nil
|
24
26
|
expect(@ai.mimetype).to eq('image/tiff')
|
25
27
|
expect(@ai.file_mimetype).to eq('image/tiff')
|
28
|
+
expect(@ai.extension_mimetype).to eq('image/tiff')
|
29
|
+
expect(@ai.exif_mimetype).to eq('image/tiff')
|
26
30
|
expect(@ai.object_type).to eq(:image)
|
27
31
|
expect(@ai.valid_image?).to eq(true)
|
28
32
|
expect(@ai.jp2able?).to eq(true)
|
@@ -51,6 +55,16 @@ describe Assembly::ObjectFile do
|
|
51
55
|
expect(@ai.mimetype).to eq('text/plain')
|
52
56
|
end
|
53
57
|
|
58
|
+
it 'sets a mimetype of application/x-tgif for .obj 3d files if we prefer the mimetype extension gem over unix file system command' do
|
59
|
+
@ai = described_class.new(TEST_OBJ_FILE, mime_type_order: %i[extension file exif])
|
60
|
+
expect(@ai.mimetype).to eq('application/x-tgif')
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'ignores invald mimetype generation methods and still sets a mimetype of application/x-tgif for .obj 3d files if we prefer the mimetype extension gem over unix file system command' do
|
64
|
+
@ai = described_class.new(TEST_OBJ_FILE, mime_type_order: %i[bogus extension file])
|
65
|
+
expect(@ai.mimetype).to eq('application/x-tgif')
|
66
|
+
end
|
67
|
+
|
54
68
|
it 'sets the correct mimetype of plain/text for .ply 3d files' do
|
55
69
|
@ai = described_class.new(TEST_PLY_FILE)
|
56
70
|
expect(@ai.mimetype).to eq('text/plain')
|
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'simplecov'
|
2
4
|
SimpleCov.start
|
3
5
|
|
4
|
-
bootfile = File.expand_path(File.dirname(__FILE__)
|
6
|
+
bootfile = File.expand_path("#{File.dirname(__FILE__)}/../config/boot")
|
5
7
|
require bootfile
|
6
8
|
|
7
9
|
RSpec.configure do |config|
|
@@ -52,7 +54,7 @@ TEST_RES3_TEI = File.join(TEST_INPUT_DIR, 'res3_teifile.txt')
|
|
52
54
|
|
53
55
|
TEST_FILE_NO_EXIF = File.join(TEST_INPUT_DIR, 'file_with_no_exif.xml')
|
54
56
|
|
55
|
-
TEST_OBJ_FILE=File.join(TEST_INPUT_DIR,'someobject.obj')
|
56
|
-
TEST_PLY_FILE=File.join(TEST_INPUT_DIR,'someobject.ply')
|
57
|
+
TEST_OBJ_FILE = File.join(TEST_INPUT_DIR, 'someobject.obj')
|
58
|
+
TEST_PLY_FILE = File.join(TEST_INPUT_DIR, 'someobject.ply')
|
57
59
|
|
58
|
-
TEST_DRUID = 'nx288wh8889'
|
60
|
+
TEST_DRUID = 'nx288wh8889'
|
metadata
CHANGED
@@ -1,18 +1,74 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: assembly-objectfile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Mangiafico
|
8
8
|
- Renzo Sanchez-Silva
|
9
9
|
- Monty Hindman
|
10
10
|
- Tony Calavano
|
11
|
-
autorequire:
|
11
|
+
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2021-03-16 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: activesupport
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 5.2.0
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 5.2.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: deprecation
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '0'
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: dry-struct
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - "~>"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '1.0'
|
51
|
+
type: :runtime
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - "~>"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '1.0'
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: dry-types
|
60
|
+
requirement: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - "~>"
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '1.1'
|
65
|
+
type: :runtime
|
66
|
+
prerelease: false
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - "~>"
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '1.1'
|
16
72
|
- !ruby/object:Gem::Dependency
|
17
73
|
name: mime-types
|
18
74
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,16 +185,16 @@ dependencies:
|
|
129
185
|
name: simplecov
|
130
186
|
requirement: !ruby/object:Gem::Requirement
|
131
187
|
requirements:
|
132
|
-
- - "
|
188
|
+
- - "~>"
|
133
189
|
- !ruby/object:Gem::Version
|
134
|
-
version:
|
190
|
+
version: 0.17.0
|
135
191
|
type: :development
|
136
192
|
prerelease: false
|
137
193
|
version_requirements: !ruby/object:Gem::Requirement
|
138
194
|
requirements:
|
139
|
-
- - "
|
195
|
+
- - "~>"
|
140
196
|
- !ruby/object:Gem::Version
|
141
|
-
version:
|
197
|
+
version: 0.17.0
|
142
198
|
description: Get exif data, file sizes and more.
|
143
199
|
email:
|
144
200
|
- pmangiafico@stanford.edu
|
@@ -146,6 +202,8 @@ executables: []
|
|
146
202
|
extensions: []
|
147
203
|
extra_rdoc_files: []
|
148
204
|
files:
|
205
|
+
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
206
|
+
- ".github/pull_request_template.md"
|
149
207
|
- ".gitignore"
|
150
208
|
- ".rubocop.yml"
|
151
209
|
- ".rubocop_todo.yml"
|
@@ -161,6 +219,11 @@ files:
|
|
161
219
|
- config/boot.rb
|
162
220
|
- lib/assembly-objectfile.rb
|
163
221
|
- lib/assembly-objectfile/content_metadata.rb
|
222
|
+
- lib/assembly-objectfile/content_metadata/config.rb
|
223
|
+
- lib/assembly-objectfile/content_metadata/file.rb
|
224
|
+
- lib/assembly-objectfile/content_metadata/file_set.rb
|
225
|
+
- lib/assembly-objectfile/content_metadata/file_set_builder.rb
|
226
|
+
- lib/assembly-objectfile/content_metadata/nokogiri_builder.rb
|
164
227
|
- lib/assembly-objectfile/object_file.rb
|
165
228
|
- lib/assembly-objectfile/object_fileable.rb
|
166
229
|
- lib/assembly-objectfile/version.rb
|
@@ -209,24 +272,23 @@ homepage: https://github.com/sul-dlss/assembly-objectfile
|
|
209
272
|
licenses:
|
210
273
|
- ALv2
|
211
274
|
metadata: {}
|
212
|
-
post_install_message:
|
275
|
+
post_install_message:
|
213
276
|
rdoc_options: []
|
214
277
|
require_paths:
|
215
278
|
- lib
|
216
279
|
required_ruby_version: !ruby/object:Gem::Requirement
|
217
280
|
requirements:
|
218
|
-
- - "
|
281
|
+
- - "~>"
|
219
282
|
- !ruby/object:Gem::Version
|
220
|
-
version: '
|
283
|
+
version: '2.5'
|
221
284
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
222
285
|
requirements:
|
223
286
|
- - ">="
|
224
287
|
- !ruby/object:Gem::Version
|
225
288
|
version: '0'
|
226
289
|
requirements: []
|
227
|
-
|
228
|
-
|
229
|
-
signing_key:
|
290
|
+
rubygems_version: 3.2.14
|
291
|
+
signing_key:
|
230
292
|
specification_version: 4
|
231
293
|
summary: Ruby immplementation of file services needed to prepare objects to be accessioned
|
232
294
|
in SULAIR digital library
|