lib/fluent/format/check.rb in fluent-format-0.2.2 vs lib/fluent/format/check.rb in fluent-format-0.2.3
- old
+ new
@@ -5,11 +5,12 @@
class Check
# Initialize
#
# @param [IO|String] config_dev
# @param [String] plugin_dir the plugin directory
- def initialize(config_dev, plugin_dir = nil)
+ # @param [Array] libs load libraries (to require)
+ def initialize(config_dev, plugin_dir = nil, libs = nil)
@opts = {
:config_path => config_dev, # Fluent::DEFAULT_CONFIG_PATH,
:plugin_dirs => [Fluent::DEFAULT_PLUGIN_DIR],
:log_level => Fluent::Log::LEVEL_INFO,
:log_path => nil,
@@ -20,9 +21,10 @@
:chgroup => nil,
:suppress_interval => 0,
:suppress_repeated_stacktrace => false,
}
@opts[:plugin_dirs] << plugin_dir if plugin_dir
+ @opts[:libs] += libs if libs and !libs.empty?
end
# Check config file
#
# @raise Fluent::ConfigParseError if conf has syntax errors