diff --git a/active_encode.gemspec b/active_encode.gemspec index 96128ed..396c325 100644 --- a/active_encode.gemspec +++ b/active_encode.gemspec @@ -15,9 +15,8 @@ Gem::Specification.new do |spec| spec.homepage = "https://github.com/samvera-labs/active_encode" spec.license = "Apache-2.0" - spec.files = `git ls-files -z`.split("\x0") + spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } - spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] spec.metadata = { "rubygems_mfa_required" => "true" } diff --git a/lib/active_encode/version.rb b/lib/active_encode/version.rb index c326afa..b13e960 100644 --- a/lib/active_encode/version.rb +++ b/lib/active_encode/version.rb @@ -1,4 +1,4 @@ # frozen_string_literal: true module ActiveEncode - VERSION = '1.2.0' + VERSION = '1.2.1' end diff --git "a/spec/fixtures/@\341\213\210\341\213\263\341\214\205\341\210\205 \341\210\233\341\210\255 \341\211\242. \341\210\206\341\212\225 \341\214\250\341\210\255\341\210\265. \341\210\205 \341\212\240\341\211\265\341\210\213\341\210\260!@#$^^&$%&.low.mov" "b/spec/fixtures/@\341\213\210\341\213\263\341\214\205\341\210\205 \341\210\233\341\210\255 \341\211\242. \341\210\206\341\212\225 \341\214\250\341\210\255\341\210\265. \341\210\205 \341\212\240\341\211\265\341\210\213\341\210\260!@#$^^&$%&.low.mov" deleted file mode 100644 index e78075b..0000000 Binary files "a/spec/fixtures/@\341\213\210\341\213\263\341\214\205\341\210\205 \341\210\233\341\210\255 \341\211\242. \341\210\206\341\212\225 \341\214\250\341\210\255\341\210\265. \341\210\205 \341\212\240\341\211\265\341\210\213\341\210\260!@#$^^&$%&.low.mov" and /dev/null differ diff --git "a/spec/fixtures/@\341\213\210\341\213\263\341\214\205\341\210\205 \341\210\233\341\210\255 \341\211\242. \341\210\206\341\212\225 \341\214\250\341\210\255\341\210\265. \341\210\205 \341\212\240\341\211\265\341\210\213\341\210\260!@#$^^&$%&.low.mp4" "b/spec/fixtures/@\341\213\210\341\213\263\341\214\205\341\210\205 \341\210\233\341\210\255 \341\211\242. \341\210\206\341\212\225 \341\214\250\341\210\255\341\210\265. \341\210\205 \341\212\240\341\211\265\341\210\213\341\210\260!@#$^^&$%&.low.mp4" new file mode 100644 index 0000000..5cd6621 Binary files /dev/null and "b/spec/fixtures/@\341\213\210\341\213\263\341\214\205\341\210\205 \341\210\233\341\210\255 \341\211\242. \341\210\206\341\212\225 \341\214\250\341\210\255\341\210\265. \341\210\205 \341\212\240\341\211\265\341\210\213\341\210\260!@#$^^&$%&.low.mp4" differ diff --git "a/spec/fixtures/@\341\213\210\341\213\263\341\214\205\341\210\205 \341\210\233\341\210\255 \341\211\242. \341\210\206\341\212\225 \341\214\250\341\210\255\341\210\265. \341\210\205 \341\212\240\341\211\265\341\210\213\341\210\260!@#$^^&$%&.mov" "b/spec/fixtures/@\341\213\210\341\213\263\341\214\205\341\210\205 \341\210\233\341\210\255 \341\211\242. \341\210\206\341\212\225 \341\214\250\341\210\255\341\210\265. \341\210\205 \341\212\240\341\211\265\341\210\213\341\210\260!@#$^^&$%&.mov" deleted file mode 100644 index e78075b..0000000 Binary files "a/spec/fixtures/@\341\213\210\341\213\263\341\214\205\341\210\205 \341\210\233\341\210\255 \341\211\242. \341\210\206\341\212\225 \341\214\250\341\210\255\341\210\265. \341\210\205 \341\212\240\341\211\265\341\210\213\341\210\260!@#$^^&$%&.mov" and /dev/null differ diff --git "a/spec/fixtures/@\341\213\210\341\213\263\341\214\205\341\210\205 \341\210\233\341\210\255 \341\211\242. \341\210\206\341\212\225 \341\214\250\341\210\255\341\210\265. \341\210\205 \341\212\240\341\211\265\341\210\213\341\210\260!@#$^^&$%&.mp4" "b/spec/fixtures/@\341\213\210\341\213\263\341\214\205\341\210\205 \341\210\233\341\210\255 \341\211\242. \341\210\206\341\212\225 \341\214\250\341\210\255\341\210\265. \341\210\205 \341\212\240\341\211\265\341\210\213\341\210\260!@#$^^&$%&.mp4" new file mode 100644 index 0000000..5cd6621 Binary files /dev/null and "b/spec/fixtures/@\341\213\210\341\213\263\341\214\205\341\210\205 \341\210\233\341\210\255 \341\211\242. \341\210\206\341\212\225 \341\214\250\341\210\255\341\210\265. \341\210\205 \341\212\240\341\211\265\341\210\213\341\210\260!@#$^^&$%&.mp4" differ diff --git a/spec/fixtures/file_without_metadata.low.webm b/spec/fixtures/file_without_metadata.low.webm index 7cb5f20..bff79ed 100644 Binary files a/spec/fixtures/file_without_metadata.low.webm and b/spec/fixtures/file_without_metadata.low.webm differ diff --git a/spec/fixtures/file_without_metadata.mp4 b/spec/fixtures/file_without_metadata.mp4 index 7cb5f20..bff79ed 100644 Binary files a/spec/fixtures/file_without_metadata.mp4 and b/spec/fixtures/file_without_metadata.mp4 differ diff --git a/spec/fixtures/file_without_metadata.webm b/spec/fixtures/file_without_metadata.webm index 7cb5f20..bff79ed 100644 Binary files a/spec/fixtures/file_without_metadata.webm and b/spec/fixtures/file_without_metadata.webm differ diff --git a/spec/integration/elastic_transcoder_adapter_spec.rb b/spec/integration/elastic_transcoder_adapter_spec.rb index d299987..299432f 100644 --- a/spec/integration/elastic_transcoder_adapter_spec.rb +++ b/spec/integration/elastic_transcoder_adapter_spec.rb @@ -159,8 +159,8 @@ end context "when filename has special characters" do context "non-s3 file" do - let(:input) { ["'file_with_single_quote'.mp4", '"file_with_double_quote".mp4', "file with space.mp4", "file.with...periods.mp4", "file.with :=+%sp3c!l-ch4cts().mp4", '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov'] } - let(:clean) { ["_file_with_single_quote_.mp4", "_file_with_double_quote_.mp4", "file_with_space.mp4", "filewithperiods.mp4", "filewith_____sp3c_l-ch4cts__.mp4", '__________________________________.mov'] } + let(:input) { ["'file_with_single_quote'.mp4", '"file_with_double_quote".mp4', "file with space.mp4", "file.with...periods.mp4", "file.with :=+%sp3c!l-ch4cts().mp4", '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4'] } + let(:clean) { ["_file_with_single_quote_.mp4", "_file_with_double_quote_.mp4", "file_with_space.mp4", "filewithperiods.mp4", "filewith_____sp3c_l-ch4cts__.mp4", '__________________________________.mp4'] } let(:source_bucket) { "bucket1" } it "calls the #upload_to_s3 method" do @@ -171,8 +171,8 @@ end end context "s3 file" do - let(:input_urls) { ["s3://bucket1/'file_with_single_quote'.mp4", 's3://bucket1/"file_with_double_quote".mp4', "s3://bucket1/file with space.mp4", "s3://bucket1/file.with...periods.mp4", "s3://bucket1/file.with :=+%sp3c!l-ch4cts().mp4", 's3://bucket1/@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov'] } - let(:clean) { ["_file_with_single_quote_.mp4", "_file_with_double_quote_.mp4", "file_with_space.mp4", "filewithperiods.mp4", "filewith_____sp3c_l-ch4cts__.mp4", '__________________________________.mov'] } + let(:input_urls) { ["s3://bucket1/'file_with_single_quote'.mp4", 's3://bucket1/"file_with_double_quote".mp4', "s3://bucket1/file with space.mp4", "s3://bucket1/file.with...periods.mp4", "s3://bucket1/file.with :=+%sp3c!l-ch4cts().mp4", 's3://bucket1/@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4'] } + let(:clean) { ["_file_with_single_quote_.mp4", "_file_with_double_quote_.mp4", "file_with_space.mp4", "filewithperiods.mp4", "filewith_____sp3c_l-ch4cts__.mp4", '__________________________________.mp4'] } let(:source_bucket) { "bucket2" } it "calls the #check_s3_bucket method" do diff --git a/spec/integration/ffmpeg_adapter_spec.rb b/spec/integration/ffmpeg_adapter_spec.rb index 897bc6e..277e38f 100644 --- a/spec/integration/ffmpeg_adapter_spec.rb +++ b/spec/integration/ffmpeg_adapter_spec.rb @@ -141,8 +141,8 @@ def find_encode(id) end it "assigns the correct duration to the encode" do - expect(create_without_metadata_job.input.duration).to eq 68_653 - expect(find_without_metadata_job.input.duration).to eq 68_653 + expect(create_without_metadata_job.input.duration).to eq 4_640 + expect(find_without_metadata_job.input.duration).to eq 4_640 end context 'when uri encoded' do @@ -162,8 +162,8 @@ def find_encode(id) end it "assigns the correct duration to the encode" do - expect(create_without_metadata_job.input.duration).to eq 68_653 - expect(find_without_metadata_job.input.duration).to eq 68_653 + expect(create_without_metadata_job.input.duration).to eq 4_640 + expect(find_without_metadata_job.input.duration).to eq 4_640 end end end @@ -280,7 +280,7 @@ def find_encode(id) let(:file_with_special_characters) { "file://" + Rails.root.join('..', 'spec', 'fixtures', 'file.with :=+%sp3c!l-ch4cts().mp4').to_s } let!(:create_special_characters_job) { ActiveEncode::Base.create(file_with_special_characters, outputs: [{ label: "low", ffmpeg_opt: "-s 640x480", extension: 'mp4' }]) } let(:find_special_characters_job) { ActiveEncode::Base.find create_special_characters_job.id } - let(:file_with_more_special_characters) { "file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov').to_s } + let(:file_with_more_special_characters) { "file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4').to_s } let!(:create_more_special_characters_job) { ActiveEncode::Base.create(file_with_more_special_characters, outputs: [{ label: "low", ffmpeg_opt: "-s 640x480", extension: 'mp4' }]) } let(:find_more_special_characters_job) { ActiveEncode::Base.find create_more_special_characters_job.id } @@ -302,7 +302,7 @@ def find_encode(id) context 'when uri encoded' do let(:file_with_special_characters) { Addressable::URI.encode("file://" + Rails.root.join('..', 'spec', 'fixtures', 'file.with :=+%sp3c!l-ch4cts().mp4').to_s) } - let(:file_with_more_special_characters) { Addressable::URI.encode("file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov').to_s) } + let(:file_with_more_special_characters) { Addressable::URI.encode("file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4').to_s) } it "does not have errors" do sleep 2 diff --git a/spec/integration/media_convert_adapter_spec.rb b/spec/integration/media_convert_adapter_spec.rb index 574cca2..3a01db5 100644 --- a/spec/integration/media_convert_adapter_spec.rb +++ b/spec/integration/media_convert_adapter_spec.rb @@ -293,8 +293,8 @@ def reconstitute_response(fixture_path) end context "when filename has special characters" do context "non-s3 file" do - let(:input) { ["'file_with_single_quote'.mp4", '"file_with_double_quote".mp4', "file with space.mp4", "file.with...periods.mp4", "file.with :=+%sp3c!l-ch4cts().mp4", '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov'] } - let(:clean) { ["_file_with_single_quote_.mp4", "_file_with_double_quote_.mp4", "file_with_space.mp4", "filewithperiods.mp4", "filewith_____sp3c_l-ch4cts__.mp4", '__________________________________.mov'] } + let(:input) { ["'file_with_single_quote'.mp4", '"file_with_double_quote".mp4', "file with space.mp4", "file.with...periods.mp4", "file.with :=+%sp3c!l-ch4cts().mp4", '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4'] } + let(:clean) { ["_file_with_single_quote_.mp4", "_file_with_double_quote_.mp4", "file_with_space.mp4", "filewithperiods.mp4", "filewith_____sp3c_l-ch4cts__.mp4", '__________________________________.mp4'] } let(:source_bucket) { "bucket1" } it "calls the #upload_to_s3 method" do @@ -305,8 +305,8 @@ def reconstitute_response(fixture_path) end end context "s3 file" do - let(:input_urls) { ["s3://bucket1/'file_with_single_quote'.mp4", 's3://bucket1/"file_with_double_quote".mp4', "s3://bucket1/file with space.mp4", "s3://bucket1/file.with...periods.mp4", "s3://bucket1/file.with :=+%sp3c!l-ch4cts().mp4", 's3://bucket1/@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov'] } - let(:clean) { ["_file_with_single_quote_.mp4", "_file_with_double_quote_.mp4", "file_with_space.mp4", "filewithperiods.mp4", "filewith_____sp3c_l-ch4cts__.mp4", '__________________________________.mov'] } + let(:input_urls) { ["s3://bucket1/'file_with_single_quote'.mp4", 's3://bucket1/"file_with_double_quote".mp4', "s3://bucket1/file with space.mp4", "s3://bucket1/file.with...periods.mp4", "s3://bucket1/file.with :=+%sp3c!l-ch4cts().mp4", 's3://bucket1/@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4'] } + let(:clean) { ["_file_with_single_quote_.mp4", "_file_with_double_quote_.mp4", "file_with_space.mp4", "filewithperiods.mp4", "filewith_____sp3c_l-ch4cts__.mp4", '__________________________________.mp4'] } let(:source_bucket) { "bucket2" } it "calls the #check_s3_bucket method" do diff --git a/spec/integration/pass_through_adapter_spec.rb b/spec/integration/pass_through_adapter_spec.rb index 6a3375f..1b92992 100644 --- a/spec/integration/pass_through_adapter_spec.rb +++ b/spec/integration/pass_through_adapter_spec.rb @@ -134,8 +134,8 @@ def touch_fixture(id, filename) end it "assigns the correct duration to the encode" do - expect(create_without_metadata_job.input.duration).to eq 68_653 - expect(find_without_metadata_job.input.duration).to eq 68_653 + expect(create_without_metadata_job.input.duration).to eq 4_640 + expect(find_without_metadata_job.input.duration).to eq 4_640 end context 'when uri encoded' do @@ -151,8 +151,8 @@ def touch_fixture(id, filename) end it "assigns the correct duration to the encode" do - expect(create_without_metadata_job.input.duration).to eq 68_653 - expect(find_without_metadata_job.input.duration).to eq 68_653 + expect(create_without_metadata_job.input.duration).to eq 4_640 + expect(find_without_metadata_job.input.duration).to eq 4_640 end end end @@ -246,8 +246,8 @@ def touch_fixture(id, filename) let(:file_with_special_characters_derivative) { "file://" + Rails.root.join('..', 'spec', 'fixtures', 'file.with :=+%sp3c!l-ch4cts().mp4').to_s } let!(:create_special_characters_job) { ActiveEncode::Base.create(file_with_special_characters, outputs: [{ label: "low", url: file_with_special_characters_derivative }]) } let(:find_special_characters_job) { ActiveEncode::Base.find create_special_characters_job.id } - let(:file_with_more_special_characters) { "file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov').to_s } - let(:file_with_more_special_characters_derivative) { "file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov').to_s } + let(:file_with_more_special_characters) { "file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4').to_s } + let(:file_with_more_special_characters_derivative) { "file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4').to_s } let!(:create_more_special_characters_job) { ActiveEncode::Base.create(file_with_more_special_characters, outputs: [{ label: "low", url: file_with_more_special_characters_derivative }]) } let(:find_more_special_characters_job) { ActiveEncode::Base.find create_more_special_characters_job.id } @@ -264,8 +264,8 @@ def touch_fixture(id, filename) context 'when uri encoded' do let(:file_with_special_characters) { Addressable::URI.encode("file://" + Rails.root.join('..', 'spec', 'fixtures', 'file.with :=+%sp3c!l-ch4cts().mp4').to_s) } let(:file_with_special_characters_derivative) { "file://" + Rails.root.join('..', 'spec', 'fixtures', 'file.with :=+%sp3c!l-ch4cts().mp4').to_s } - let(:file_with_more_special_characters) { Addressable::URI.encode("file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov').to_s) } - let(:file_with_more_special_characters_derivative) { "file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mov').to_s } + let(:file_with_more_special_characters) { Addressable::URI.encode("file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4').to_s) } + let(:file_with_more_special_characters_derivative) { "file://" + Rails.root.join('..', 'spec', 'fixtures', '@ወዳጅህ ማር ቢ. ሆን ጨርስ. ህ አትላሰ!@#$^^&$%&.mp4').to_s } it "does not have errors" do expect(find_special_characters_job.errors).to be_empty