lib/ragent/plugins.rb in ragent-0.0.4 vs lib/ragent/plugins.rb in ragent-0.0.5
- old
+ new
@@ -16,18 +16,18 @@
require "ragent/plugin/#{name}"
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: #{plugin.name}"
+ info "Configure: #{name}"
running_plugin = plugin.new(@ragent)
running_plugin.configure(*args, &block)
- debug "Configured: #{plugin.name}"
+ debug "Configured: #{name}"
@running_plugins << running_plugin
end
- def register(name, mod)
- @plugins[name.to_s] = mod
+ def register(mod)
+ @plugins[mod.plugin_name] = mod
end
def start
@running_plugins.each(&:start)
end