Class: Fluentspec::Supervisor

Inherits:
Object
  • Object
show all
Defined in:
lib/fluentspec/supervisor.rb

Instance Method Summary collapse

Constructor Details

#initialize(conf = nil) ⇒ Supervisor

Returns a new instance of Supervisor.

Raises:

  • (ArgumentError)


33
34
35
36
37
38
39
40
# File 'lib/fluentspec/supervisor.rb', line 33

def initialize(conf = nil)
  raise ArgumentError if conf.nil?
  @conf = conf
  opts = Fluent::Supervisor.default_options
  opts[:config_path] = @conf
  @sv = Fluent::Supervisor.new(opts)
  @sv.run_spec
end

Instance Method Details

#resetObject

rubocop:disable Lint/HandleExceptions



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

def reset
  opts = Fluent::Supervisor.default_options
  @sv = Fluent::Supervisor.new(opts)
  @sv.run_spec
rescue
end