Sort library files before loading them so load order is predictable (#2475)

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
Clinton Wolfe 2018-01-22 16:17:39 -05:00 committed by Dominik Richter
parent dee94b6416
commit 0d5f6e0a7e

View file

@ -116,6 +116,7 @@ module Inspec
lib_prefix = 'libraries' + File::SEPARATOR
autoloads = []
libs.sort_by! { |l| l[1] } # Sort on source path so load order is deterministic
libs.each do |content, source, line|
path = source
if source.start_with?(lib_prefix)