assembly-objectfile 2.1.4 → 2.2.0
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 +4 -4
- data/.circleci/config.yml +1 -1
- data/Gemfile.lock +2 -2
- data/lib/assembly/object_file/version.rb +1 -1
- data/lib/assembly-objectfile.rb +2 -1
- data/spec/assembly/object_file_spec.rb +24 -0
- data/spec/fixtures/input/test.vtt +1504 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbf476be726445b2be5a1ff9f4787d12f7e8016a828d22937c488c51d53c5071
|
4
|
+
data.tar.gz: b4e1953bfee015bb956dbc20ab5ab1ce09dd6e953d50aeed81c2f7c8595a04d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b0f524f32a5082068cddec3d5bd8f98371d79ca5c76867a7f7b2f0125c0452b035fb9e6a424a2d6e734b5ef61380f8821bf0be012ce8ea3ccdb25a9249943bd
|
7
|
+
data.tar.gz: 1fc0f0b3937c254667c6428bbb26cd1f901d175f26a6c026e07c497ee4e24bf06566ef2640f0af3c851e8bca233e10f2be84e123b5655e6885db333c004e0ca1
|
data/.circleci/config.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -55,7 +55,7 @@ GEM
|
|
55
55
|
diff-lcs (>= 1.2.0, < 2.0)
|
56
56
|
rspec-support (~> 3.12.0)
|
57
57
|
rspec-support (3.12.0)
|
58
|
-
rubocop (1.
|
58
|
+
rubocop (1.51.0)
|
59
59
|
json (~> 2.3)
|
60
60
|
parallel (~> 1.10)
|
61
61
|
parser (>= 3.2.0.0)
|
@@ -69,7 +69,7 @@ GEM
|
|
69
69
|
parser (>= 3.2.1.0)
|
70
70
|
rubocop-capybara (2.18.0)
|
71
71
|
rubocop (~> 1.41)
|
72
|
-
rubocop-factory_bot (2.
|
72
|
+
rubocop-factory_bot (2.23.0)
|
73
73
|
rubocop (~> 1.33)
|
74
74
|
rubocop-rspec (2.22.0)
|
75
75
|
rubocop (~> 1.33)
|
data/lib/assembly-objectfile.rb
CHANGED
@@ -18,7 +18,8 @@ module Assembly
|
|
18
18
|
# the unix file system command returns the mapping format is "extension with period: returned mimetype",
|
19
19
|
# e.g. for any .json file, you will always get `application/json`
|
20
20
|
OVERRIDE_MIMETYPES = {
|
21
|
-
'.json': 'application/json'
|
21
|
+
'.json': 'application/json',
|
22
|
+
'.vtt': 'text/vtt'
|
22
23
|
}.freeze
|
23
24
|
end
|
24
25
|
|
@@ -15,6 +15,7 @@ describe Assembly::ObjectFile do
|
|
15
15
|
let(:json_fixture_file) { File.join(fixture_input_dir, 'test.json') }
|
16
16
|
let(:obj_fixture_file) { File.join(fixture_input_dir, 'someobject.obj') }
|
17
17
|
let(:ply_fixture_file) { File.join(fixture_input_dir, 'someobject.ply') }
|
18
|
+
let(:vtt_fixture_file) { File.join(fixture_input_dir, 'test.vtt') }
|
18
19
|
|
19
20
|
describe '.common_path' do
|
20
21
|
context 'when common path is 2 nodes out of 4' do
|
@@ -310,6 +311,15 @@ describe Assembly::ObjectFile do
|
|
310
311
|
expect(object_file.mimetype).to eq('application/json') # our configured mapping overrides both
|
311
312
|
end
|
312
313
|
end
|
314
|
+
|
315
|
+
context 'when .vtt file' do
|
316
|
+
it 'uses the manual mapping to set the correct mimetype of text/vtt for a .vtt file' do
|
317
|
+
object_file = described_class.new(vtt_fixture_file)
|
318
|
+
expect(object_file.send(:exif_mimetype)).to be_nil # exif
|
319
|
+
expect(object_file.send(:file_mimetype)).to eq('text/plain') # unix file system command
|
320
|
+
expect(object_file.mimetype).to eq('text/vtt') # our configured mapping overrides both
|
321
|
+
end
|
322
|
+
end
|
313
323
|
end
|
314
324
|
|
315
325
|
describe '#file_mimetype (unix file system command)' do
|
@@ -434,6 +444,13 @@ describe Assembly::ObjectFile do
|
|
434
444
|
expect(object_file.send(:extension_mimetype)).to eq('image/tiff')
|
435
445
|
end
|
436
446
|
end
|
447
|
+
|
448
|
+
context 'with .vtt file' do
|
449
|
+
it 'text/plain' do
|
450
|
+
object_file = described_class.new(vtt_fixture_file)
|
451
|
+
expect(object_file.send(:extension_mimetype)).to eq('text/vtt')
|
452
|
+
end
|
453
|
+
end
|
437
454
|
end
|
438
455
|
|
439
456
|
describe '#exif_mimetype' do
|
@@ -450,5 +467,12 @@ describe Assembly::ObjectFile do
|
|
450
467
|
expect(object_file.send(:exif_mimetype)).to be_nil
|
451
468
|
end
|
452
469
|
end
|
470
|
+
|
471
|
+
context 'when .vtt file' do
|
472
|
+
it 'nil' do
|
473
|
+
object_file = described_class.new(vtt_fixture_file)
|
474
|
+
expect(object_file.send(:exif_mimetype)).to be_nil
|
475
|
+
end
|
476
|
+
end
|
453
477
|
end
|
454
478
|
end
|