lib/inspec/profile.rb in inspec-1.27.0 vs lib/inspec/profile.rb in inspec-1.28.0

- old
+ new

@@ -35,20 +35,20 @@ def self.copy_deps_into_cache(file_provider, opts) # filter content cache = file_provider.files.find_all do |entry| entry.start_with?('vendor') end - content = Hash[cache.map { |x| [x, file_provider.read(x)] }] + content = Hash[cache.map { |x| [x, file_provider.binread(x)] }] keys = content.keys keys.each do |key| next if content[key].nil? # remove prefix rel = Pathname.new(key).relative_path_from(Pathname.new('vendor')).to_s tar = Pathname.new(opts[:cache].path).join(rel) FileUtils.mkdir_p tar.dirname.to_s Inspec::Log.debug "Copy #{tar} to cache directory" - File.write(tar.to_s, content[key].force_encoding('UTF-8')) + File.binwrite(tar.to_s, content[key]) end end def self.for_path(path, opts) file_provider = FileProvider.for_path(path)