Method: Fluent::Config::DSL::Element#include
- Defined in:
- lib/fluent/config/dsl.rb
#include(*args) ⇒ Object
111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/fluent/config/dsl.rb', line 111 def include(*args) ::Kernel.raise ::ArgumentError, "#{name} block requires arguments for include path" if args.nil? || args.size != 1 if /\.rb$/.match?(args.first) path = File.(args.first) data = File.read(path) self.instance_eval(data, path) else ss = StringScanner.new('') Config::V1Parser.new(ss, @proxy.include_basepath, '', nil).eval_include(@attrs, @elements, args.first) end end |