Skip to content

Commit

Permalink
fix: resolve issues with Transcoder kwargs in Ruby 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
bajankristof committed Apr 26, 2024
1 parent accc626 commit 5da3b49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/ffmpeg/transcoder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class << self
def initialize(
input,
output_path,
options = EncodingOptions.new,
options,
validate: true,
preserve_aspect_ratio: true,
input_options: []
Expand Down
8 changes: 2 additions & 6 deletions spec/ffmpeg/transcoder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,11 @@ module FFMPEG
let(:input) { media }
let(:output_ext) { 'mp4' }
let(:output_path) { tmp_file(ext: output_ext) }
let(:options) { nil }
let(:options) { EncodingOptions.new }
let(:kwargs) { nil }

subject do
if options.nil? && kwargs.nil?
described_class.new(input, output_path)
elsif options.nil?
described_class.new(input, output_path, **kwargs)
elsif kwargs.nil?
if kwargs.nil?
described_class.new(input, output_path, options)
else
described_class.new(input, output_path, options, **kwargs)
Expand Down

0 comments on commit 5da3b49

Please sign in to comment.