From d5bcb123c98e27a2dfaa2b64f832f8ec9aef7358 Mon Sep 17 00:00:00 2001 From: bajankristof Date: Fri, 29 Nov 2024 16:12:25 +0100 Subject: [PATCH] refactor(reporters): simplify the match? method of the progress and silence reporters Refs: ARC-9901 --- lib/ffmpeg/reporters/progress.rb | 2 +- lib/ffmpeg/reporters/silence.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ffmpeg/reporters/progress.rb b/lib/ffmpeg/reporters/progress.rb index 7960efa..85de38b 100644 --- a/lib/ffmpeg/reporters/progress.rb +++ b/lib/ffmpeg/reporters/progress.rb @@ -7,7 +7,7 @@ module Reporters # Represents the progress of an encoding operation. class Progress < Output def self.match?(line) - line =~ /^\s*frame=/ ? true : false + line.match?(/^\s*frame=/) end # Returns the current frame number. diff --git a/lib/ffmpeg/reporters/silence.rb b/lib/ffmpeg/reporters/silence.rb index 97ad2e2..fb8820e 100644 --- a/lib/ffmpeg/reporters/silence.rb +++ b/lib/ffmpeg/reporters/silence.rb @@ -7,7 +7,7 @@ module Reporters # Represents a silence report from ffmpeg. class Silence < Output def self.match?(line) - line =~ /^\[silencedetect @ \w+\]/ ? true : false + line.match?(/^\[silencedetect @ \w+\]/) end # Returns the ID of the filter.