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



34
35
36
# File 'lib/fluent/config/dsl.rb', line 34

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

.read(path) ⇒ Object



28
29
30
31
32
# File 'lib/fluent/config/dsl.rb', line 28

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