From 19df9b2b671feb1bd7bde8c8cace15080ec68d94 Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Tue, 12 Nov 2024 14:52:04 -0600 Subject: [PATCH] Use File.join() where possible --- lib/compliance_engine/module_loader.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/compliance_engine/module_loader.rb b/lib/compliance_engine/module_loader.rb index 7286f49..4303d85 100644 --- a/lib/compliance_engine/module_loader.rb +++ b/lib/compliance_engine/module_loader.rb @@ -33,9 +33,9 @@ def initialize(path, fileclass: File, dirclass: Dir) # In this directory, we want to look for all yaml and json files # under SIMP/compliance_profiles and simp/compliance_profiles. globs = ['SIMP/compliance_profiles', 'simp/compliance_profiles'] - .select { |dir| fileclass.directory?("#{path}/#{dir}") } + .select { |dir| fileclass.directory?(File.join(path, dir)) } .map { |dir| - ['yaml', 'json'].map { |type| "#{path}/#{dir}/**/*.#{type}" } + ['yaml', 'json'].map { |type| File.join(path, dir, '**', "*.#{type}") } }.flatten # debug "Globs: #{globs}" # Using .each here to make mocking with rspec easier.