lib/ragent/plugins.rb in ragent-0.0.5 vs lib/ragent/plugins.rb in ragent-0.0.6
- old
+ new
@@ -17,28 +17,32 @@
raise "plugin #{name} didn't register" unless @plugins[name.to_s]
info "loaded plugin #{name}"
# TODO: load and configure dependencies
plugin = @plugins[name.to_s]
info "Configure: #{name}"
- running_plugin = plugin.new(@ragent)
+ running_plugin = plugin.new(@ragent,plugin_name: name)
running_plugin.configure(*args, &block)
debug "Configured: #{name}"
@running_plugins << running_plugin
end
def register(mod)
@plugins[mod.plugin_name] = mod
end
def start
- @running_plugins.each(&:start)
+ @running_plugins.each do |plugin|
+ info "Starting: #{plugin.plugin_name}"
+ plugin.start
+ debug "Started: #{plugin.plugin_name}"
+ end
end
def stop
@running_plugins.each do |plugin|
- info "Stopping: #{plugin.name}"
+ info "Stopping: #{plugin.plugin_name}"
plugin.stop
- debug "Stopped: #{plugin.name}"
+ debug "Stopped: #{plugin.plugin_name}"
end
end
private