From 7f92b58140adfa7e0f72327a0ee337bea67d863f Mon Sep 17 00:00:00 2001 From: Calvin Walton <calvin.walton@kepstin.ca> Date: Thu, 6 Jun 2019 10:44:47 -0400 Subject: [PATCH] RaP: Dir.glob accepts a block directly, no need for a temp variable --- record-and-playback/core/scripts/rap-caption-inbox.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/record-and-playback/core/scripts/rap-caption-inbox.rb b/record-and-playback/core/scripts/rap-caption-inbox.rb index 026eb54ec1..abad83a508 100755 --- a/record-and-playback/core/scripts/rap-caption-inbox.rb +++ b/record-and-playback/core/scripts/rap-caption-inbox.rb @@ -126,8 +126,7 @@ caption_file_notify = proc do |json_filename| file.write(JSON.pretty_generate(captions_info)) end - caption_scripts = Dir.glob(File.expand_path('captions/*', __dir__)) - caption_scripts.each do |caption_script| + Dir.glob(File.expand_path('captions/*', __dir__)) do |caption_script| next unless File.file?(caption_script) && File.executable?(caption_script) logger.info("Running caption integration script #{caption_script}") -- GitLab