Module: Fluent::Config::DSL::Parser

Defined in:
lib/fluent/config/dsl.rb

Class Method Summary collapse

Class Method Details

.parse(source, source_path = "config.rb") ⇒ Object



32
33
34
# File 'lib/fluent/config/dsl.rb', line 32

def self.parse(source, source_path="config.rb")
  Proxy.new('ROOT', nil).eval(source, source_path).to_config_element
end

.read(path) ⇒ Object



26
27
28
29
30
# File 'lib/fluent/config/dsl.rb', line 26

def self.read(path)
  path = File.expand_path(path)
  data = File.read(path)
  parse(data, path)
end