lib/facter/util/loader.rb in facter-1.5.8 vs lib/facter/util/loader.rb in facter-1.5.9

- old
+ new

@@ -28,11 +28,11 @@ load_env search_path.each do |dir| next unless FileTest.directory?(dir) - Dir.entries(dir).each do |file| + Dir.entries(dir).sort.each do |file| path = File.join(dir, file) if File.directory?(path) load_dir(path) elsif file =~ /\.rb$/ load_file(File.join(dir, file)) @@ -60,10 +60,10 @@ private def load_dir(dir) return if dir =~ /\/\.+$/ or dir =~ /\/util$/ or dir =~ /\/lib$/ - Dir.entries(dir).find_all { |f| f =~ /\.rb$/ }.each do |file| + Dir.entries(dir).find_all { |f| f =~ /\.rb$/ }.sort.each do |file| load_file(File.join(dir, file)) end end def load_file(file)