assembly-objectfile 2.1.4 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 808727d8b4ab8ff12dd01249accf0d2a88e6821349d23950c2b8aaa2a1913391
4
- data.tar.gz: 406feb2ba9a205ec1bb3bd9aafa8a95b87ebb6f815cbb025f6e437467ab5e2dc
3
+ metadata.gz: cbf476be726445b2be5a1ff9f4787d12f7e8016a828d22937c488c51d53c5071
4
+ data.tar.gz: b4e1953bfee015bb956dbc20ab5ab1ce09dd6e953d50aeed81c2f7c8595a04d7
5
5
  SHA512:
6
- metadata.gz: de4086ae3355a75b2bdcdf95e077215b9076b607792648404004176e09c7d724dc3c3b441a89a69149f86717461651eb89c9e0d1e83582897214ba9bce600144
7
- data.tar.gz: 125078c8caf3b6f2d4fb9d17a6bd41ae622894586648cfc43a67530744cfa474505b1ddc32f3ecf51079bbcdb88978c504522a05bf3d185221da523befc9d1d0
6
+ metadata.gz: 7b0f524f32a5082068cddec3d5bd8f98371d79ca5c76867a7f7b2f0125c0452b035fb9e6a424a2d6e734b5ef61380f8821bf0be012ce8ea3ccdb25a9249943bd
7
+ data.tar.gz: 1fc0f0b3937c254667c6428bbb26cd1f901d175f26a6c026e07c497ee4e24bf06566ef2640f0af3c851e8bca233e10f2be84e123b5655e6885db333c004e0ca1
data/.circleci/config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  version: 2.1
2
2
  orbs:
3
- ruby-rails: sul-dlss/ruby-rails@3.2.0
3
+ ruby-rails: sul-dlss/ruby-rails@4.0.0
4
4
  workflows:
5
5
  build:
6
6
  jobs:
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.50.2)
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.22.0)
72
+ rubocop-factory_bot (2.23.0)
73
73
  rubocop (~> 1.33)
74
74
  rubocop-rspec (2.22.0)
75
75
  rubocop (~> 1.33)
@@ -4,6 +4,6 @@
4
4
  module Assembly
5
5
  class ObjectFile
6
6
  # Gem version
7
- VERSION = '2.1.4'
7
+ VERSION = '2.2.0'
8
8
  end
9
9
  end
@@ -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