summaryrefslogtreecommitdiff
path: root/lib/oxidized/manager.rb
diff options
context:
space:
mode:
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