Class: Fusuma::Plugin::Executors::CommandExecutor
- Defined in:
- lib/fusuma/plugin/executors/command_executor.rb
Overview
Exector plugin
Instance Method Summary collapse
Methods inherited from Base
#config_index, #config_param_types, #config_params, inherited, plugins
Instance Method Details
#executable?(event) ⇒ Boolean
24 25 26 27 28 |
# File 'lib/fusuma/plugin/executors/command_executor.rb', line 24 def executable?(event) event.tag.end_with?('_detector') && event.record.type == :index && search_command(event) end |
#execute(event) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fusuma/plugin/executors/command_executor.rb', line 10 def execute(event) search_command(event).tap do |command| break unless command MultiLogger.info(command: command) pid = fork do Process.daemon(true) exec(command.to_s) end Process.detach(pid) end end |