mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-12 09:17:05 +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
|
class Fluentd
|
||||||
module Setting
|
module Setting
|
||||||
class Config
|
class Config
|
||||||
attr_reader :config, :file
|
attr_reader :fl_config, :file
|
||||||
|
delegate :elements, :to_s, to: :fl_config
|
||||||
|
|
||||||
def initialize(config_file)
|
def initialize(config_file)
|
||||||
config = Fluent::Config.parse(IO.read(config_file), config_file, nil, true)
|
@fl_config = Fluent::Config.parse(IO.read(config_file), config_file, nil, true)
|
||||||
@config = config
|
|
||||||
@file = config_file
|
@file = config_file
|
||||||
end
|
end
|
||||||
|
|
||||||
def empty?
|
def empty?
|
||||||
config.elements.length.zero?
|
elements.length.zero?
|
||||||
end
|
end
|
||||||
|
|
||||||
def sources
|
def sources
|
||||||
config.elements.find_all do |elm|
|
elements.find_all do |elm|
|
||||||
elm.name == "source"
|
elm.name == "source"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def matches
|
def matches
|
||||||
config.elements.find_all do |elm|
|
elements.find_all do |elm|
|
||||||
elm.name == "match"
|
elm.name == "match"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user