Module: Fluent::PluginHelper

Defined in:
lib/fluent/plugin_helper.rb,
lib/fluent/plugin_helper/timer.rb,
lib/fluent/plugin_helper/inject.rb,
lib/fluent/plugin_helper/parser.rb,
lib/fluent/plugin_helper/server.rb,
lib/fluent/plugin_helper/socket.rb,
lib/fluent/plugin_helper/thread.rb,
lib/fluent/plugin_helper/counter.rb,
lib/fluent/plugin_helper/extract.rb,
lib/fluent/plugin_helper/metrics.rb,
lib/fluent/plugin_helper/storage.rb,
lib/fluent/plugin_helper/formatter.rb,
lib/fluent/plugin_helper/event_loop.rb,
lib/fluent/plugin_helper/cert_option.rb,
lib/fluent/plugin_helper/http_server.rb,
lib/fluent/plugin_helper/retry_state.rb,
lib/fluent/plugin_helper/child_process.rb,
lib/fluent/plugin_helper/event_emitter.rb,
lib/fluent/plugin_helper/socket_option.rb,
lib/fluent/plugin_helper/http_server/app.rb,
lib/fluent/plugin_helper/record_accessor.rb,
lib/fluent/plugin_helper/compat_parameters.rb,
lib/fluent/plugin_helper/service_discovery.rb,
lib/fluent/plugin_helper/http_server/router.rb,
lib/fluent/plugin_helper/http_server/server.rb,
lib/fluent/plugin_helper/http_server/methods.rb,
lib/fluent/plugin_helper/http_server/request.rb,
lib/fluent/plugin_helper/http_server/compat/server.rb,
lib/fluent/plugin_helper/service_discovery/manager.rb,
lib/fluent/plugin_helper/http_server/ssl_context_builder.rb,
lib/fluent/plugin_helper/http_server/compat/webrick_handler.rb,
lib/fluent/plugin_helper/service_discovery/round_robin_balancer.rb,
lib/fluent/plugin_helper/http_server/compat/ssl_context_extractor.rb

Defined Under Namespace

Modules: CertOption, ChildProcess, CompatParameters, Counter, EventEmitter, EventLoop, Extract, Formatter, HttpServer, Inject, Metrics, Mixin, Parser, RecordAccessor, RetryState, Server, ServiceDiscovery, Socket, SocketOption, Storage, Thread, Timer

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(mod) ⇒ Object



45
46
47
48
49
50
51
# File 'lib/fluent/plugin_helper.rb', line 45

def self.extended(mod)
  def mod.inherited(subclass)
    subclass.module_eval do
      @_plugin_helpers_list = []
    end
  end
end

Instance Method Details

#helpers(*snake_case_symbols) ⇒ Object



65
66
67
68
69
# File 'lib/fluent/plugin_helper.rb', line 65

def helpers(*snake_case_symbols)
  @_plugin_helpers_list ||= []
  @_plugin_helpers_list.concat(snake_case_symbols)
  helpers_internal(*snake_case_symbols)
end

#helpers_internal(*snake_case_symbols) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
# File 'lib/fluent/plugin_helper.rb', line 53

def helpers_internal(*snake_case_symbols)
  helper_modules = []
  snake_case_symbols.each do |name|
    begin
      helper_modules << Fluent::PluginHelper.const_get(name.to_s.split('_').map(&:capitalize).join)
    rescue NameError
      raise "Unknown plugin helper:#{name}"
    end
  end
  include(*helper_modules)
end

#plugin_helpersObject



71
72
73
# File 'lib/fluent/plugin_helper.rb', line 71

def plugin_helpers
  @_plugin_helpers_list || []
end