lib/source_readers/inspec.rb refactor 4/8: use to_h

59.8: flog total

Signed-off-by: Ryan Davis <zenspider@chef.io>
This commit is contained in:
Ryan Davis 2019-08-08 13:59:52 -07:00
parent 70d8ecf1e8
commit 5d19283199

View file

@ -46,8 +46,8 @@ module SourceReaders
end
end
def load_all files
Hash[files.map { |path| [path, @target.read(path)] }.delete_if { |_file, file| file.nil? }]
def load_all paths
paths.map { |path| [path, @target.read(path)] }.delete_if { |_file, file| file.nil? }.to_h
end
def load_tests