mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-12 01:07:09 +02:00
Refactor: Config#config -> Config#fl_config
This commit is contained in:
parent
4bc6743841
commit
645c2bbefc
@ -3,26 +3,26 @@ require 'fluent/config'
|
||||
class Fluentd
|
||||
module Setting
|
||||
class Config
|
||||
attr_reader :config, :file
|
||||
attr_reader :fl_config, :file
|
||||
delegate :elements, :to_s, to: :fl_config
|
||||
|
||||
def initialize(config_file)
|
||||
config = Fluent::Config.parse(IO.read(config_file), config_file, nil, true)
|
||||
@config = config
|
||||
@fl_config = Fluent::Config.parse(IO.read(config_file), config_file, nil, true)
|
||||
@file = config_file
|
||||
end
|
||||
|
||||
def empty?
|
||||
config.elements.length.zero?
|
||||
elements.length.zero?
|
||||
end
|
||||
|
||||
def sources
|
||||
config.elements.find_all do |elm|
|
||||
elements.find_all do |elm|
|
||||
elm.name == "source"
|
||||
end
|
||||
end
|
||||
|
||||
def matches
|
||||
config.elements.find_all do |elm|
|
||||
elements.find_all do |elm|
|
||||
elm.name == "match"
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user