Module: Fluent::ExtConfig
- Defined in:
- lib/fluent/format/format.rb
Class Method Summary collapse
-
.parse(io, fname, basepath = Dir.pwd) ⇒ String
Extended to accept config dsl.
-
.read(dev) ⇒ String
Extended to accept IO object.
Class Method Details
.parse(io, fname, basepath = Dir.pwd) ⇒ String
Extended to accept config dsl
53 54 55 56 57 58 59 |
# File 'lib/fluent/format/format.rb', line 53 def self.parse(io, fname, basepath=Dir.pwd) if fname =~ /\.rb$/ Fluent::Config::DSL::Parser.parse(io, File.join(basepath, fname)) else Fluent::Config.parse(io, fname, basepath) end end |
.read(dev) ⇒ String
Extended to accept IO object
40 41 42 43 44 45 46 |
# File 'lib/fluent/format/format.rb', line 40 def self.read(dev) if dev.respond_to?(:read) # IO object parse(dev, '-', '-') else File.open(dev) {|io| parse(io, File.basename(dev), File.dirname(dev)) } end end |