diff options
Diffstat (limited to 'lib/oxidized/core.rb')
-rw-r--r-- | lib/oxidized/core.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/oxidized/core.rb b/lib/oxidized/core.rb index 71267dd..6e7a352 100644 --- a/lib/oxidized/core.rb +++ b/lib/oxidized/core.rb @@ -6,6 +6,7 @@ module Oxidized require 'oxidized/worker' require 'oxidized/nodes' require 'oxidized/manager' + require 'oxidized/hook' class << self def new *args Core.new args @@ -13,9 +14,13 @@ module Oxidized end class Core + class NoNodesFound < OxidizedError; end + def initialize args Oxidized.mgr = Manager.new + Oxidized.Hooks = HookManager.from_config CFG nodes = Nodes.new + raise NoNodesFound, 'source returns no usable nodes' if nodes.size == 0 @worker = Worker.new nodes trap('HUP') { nodes.load } if CFG.rest? |