Skip to content

Commit

Permalink
Use File.join() where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
silug committed Nov 12, 2024
1 parent 09fac98 commit 19df9b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/compliance_engine/module_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 19df9b2

Please sign in to comment.