Module: Fluentspec

Defined in:
lib/fluentspec.rb,
lib/fluentspec/version.rb,
lib/fluentspec/supervisor.rb

Defined Under Namespace

Classes: Supervisor

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.cleanupObject



44
45
46
47
# File 'lib/fluentspec.rb', line 44

def cleanup
  @sv.reset
  @ready = false
end

.engineObject



20
21
22
# File 'lib/fluentspec.rb', line 20

def engine
  ::Fluent::Engine if Fluentspec.ready?
end

.event_routerObject



40
41
42
# File 'lib/fluentspec.rb', line 40

def event_router
  Fluentspec.root_agent.event_router if Fluentspec.ready?
end

.filtersObject



32
33
34
# File 'lib/fluentspec.rb', line 32

def filters
  Fluentspec.root_agent.filters if Fluentspec.ready?
end

.inputsObject



28
29
30
# File 'lib/fluentspec.rb', line 28

def inputs
  Fluentspec.root_agent.inputs if Fluentspec.ready?
end

.outputsObject



36
37
38
# File 'lib/fluentspec.rb', line 36

def outputs
  Fluentspec.root_agent.outputs if Fluentspec.ready?
end

.ready?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/fluentspec.rb', line 11

def ready?
  @ready ||= false
end

.root_agentObject



24
25
26
# File 'lib/fluentspec.rb', line 24

def root_agent
  Fluentspec.engine.root_agent if Fluentspec.ready?
end

.setup(config_file_path) ⇒ Object



15
16
17
18
# File 'lib/fluentspec.rb', line 15

def setup(config_file_path)
  @sv = Supervisor.new(config_file_path)
  @ready = true
end