class Alerty::Plugin::Exec

Public Class Methods

new(config) click to toggle source
# File lib/alerty/plugin/exec.rb, line 8
def initialize(config)
  raise ConfigError.new("exec: command is not configured") unless config.command
  @command = config.command
end

Public Instance Methods

alert(record) click to toggle source
# File lib/alerty/plugin/exec.rb, line 13
def alert(record)
  Alerty.logger.info "exec: echo #{record.to_json.shellescape} | #{@command}"
  Frontkick.exec("echo #{record.to_json.shellescape} | #{@command}")
end