mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
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:
parent
41b9e71792
commit
40c57454a2
1 changed files with 22 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue