Sha256: 88298e83526750c4d3b33c3d7c508294a6baf2fbdf6da078baa8d35fdc3d5503
Contents?: true
Size: 925 Bytes
Versions: 19
Compression:
Stored size: 925 Bytes
Contents
# frozen_string_literal: true require_relative './executor.rb' module Fusuma module Plugin module Executors # Exector plugin class CommandExecutor < Executor 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 def executable?(event) event.tag.end_with?('_detector') && event.record.type == :index && search_command(event) end # @param event [Event] # @return [String] def search_command(event) command_index = Config::Index.new([*event.record.index.keys, :command]) Config.search(command_index) end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems