summaryrefslogtreecommitdiff
path: root/lib/oxidized/manager.rb
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2015-09-05 12:32:37 +0300
committerSaku Ytti <saku@ytti.fi>2015-09-05 12:32:37 +0300
commitbaf19a281121cf065685f34c20978f0f2ef610af (patch)
tree959b3b4e55cbe319cc4a7bce7882fed837966ff8 /lib/oxidized/manager.rb
parentba79dea58b459eff8e2dadcffdf5a97e020c8783 (diff)
parent323f5968e3593539eca0477779114caddbfc751d (diff)
Merge branch 'feature-hook'
Diffstat (limited to 'lib/oxidized/manager.rb')
-rw-r--r--lib/oxidized/manager.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/oxidized/manager.rb b/lib/oxidized/manager.rb
index b4eaecd..bf28ae7 100644
--- a/lib/oxidized/manager.rb
+++ b/lib/oxidized/manager.rb
@@ -23,12 +23,13 @@ module Oxidized
end
end
end
- attr_reader :input, :output, :model, :source
+ attr_reader :input, :output, :model, :source, :hook
def initialize
@input = {}
@output = {}
@model = {}
@source = {}
+ @hook = {}
end
def add_input method
method = Manager.load Config::InputDir, method
@@ -53,5 +54,13 @@ module Oxidized
return false if _source.empty?
@source.merge! _source
end
+ def add_hook _hook
+ return nil if @hook.key? _hook
+ name = _hook
+ _hook = Manager.load File.join(Config::Root, 'hook'), name
+ _hook = Manager.load Config::HookDir, name if _hook.empty?
+ return false if _hook.empty?
+ @hook.merge! _hook
+ end
end
end