From 0906e02a8538b698ed8bd7c72e6a09d3e809b67a Mon Sep 17 00:00:00 2001 From: Anton Aksola Date: Fri, 28 Aug 2015 11:05:18 +0300 Subject: Initial implementation of the hook feature The current implementation is modular and allows users to define hooks in several ways: * Use one of the built-in hook types (currently only 'exec') * Define their own Hook classes inside ~/.config/oxidized/hook Exec hook type runs a user defined command with or without shell. It populates a bunch of environment variables with metadata. The command can either be run as synchronous or asynchronous. The default is synchronous. --- lib/oxidized/config.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/oxidized/config.rb') diff --git a/lib/oxidized/config.rb b/lib/oxidized/config.rb index 96c8fbf..f45004a 100644 --- a/lib/oxidized/config.rb +++ b/lib/oxidized/config.rb @@ -9,10 +9,11 @@ module Oxidized OutputDir = File.join Directory, %w(lib oxidized output) ModelDir = File.join Directory, %w(lib oxidized model) SourceDir = File.join Directory, %w(lib oxidized source) + HookDir = File.join Directory, %w(lib oxidized hook) Sleep = 1 end class << self - attr_accessor :mgr + attr_accessor :mgr, :Hooks end CFGS = Asetus.new :name=>'oxidized', :load=>false, :key_to_s=>true CFGS.default.username = 'username' -- cgit v1.2.1