introduce direct loading for modules that need to be loaded in a given order becuase of missing dependencies, this fix the issue we had with early released of JDK7 and linux systems

Fixes #3509
This commit is contained in:
Pere Urbon-Bayes 2015-06-29 11:05:45 +02:00 committed by Jordan Sissel
parent 41b9e71792
commit 40c57454a2

View file

@ -2,13 +2,33 @@
# running coverage analysis
module CoverageHelper
SKIP_LIST = ["lib/bootstrap/rspec.rb", "lib/logstash/util/prctl.rb"]
##
# Skip list used to avoid loading certain patterns within
# the logstash directories, this patterns are excluded becuause
# of potential problems or because they are going to be loaded
# in another way.
##
SKIP_LIST = Regexp.union([
/^lib\/bootstrap\/rspec.rb$/,
/^lib\/logstash\/util\/prctl.rb$/,
/^lib\/pluginmanager/
])
##
# List of files going to be loaded directly, this files
# are already loading their dependencies in the necessary
# order so everything is setup properly.
##
DIRECT_LOADING_MODULES = [ "lib/pluginmanager/main.rb" ]
def self.eager_load
Dir.glob("lib/**/*.rb") do |file|
next if SKIP_LIST.include?(file)
next if file =~ SKIP_LIST
require file
end
DIRECT_LOADING_MODULES.each do |_module|
require _module
end
end
end