lib/protonbot/plugin.rb in protonbot-0.3.2 vs lib/protonbot/plugin.rb in protonbot-0.3.3

- old
+ new

@@ -14,15 +14,15 @@ # @return [Bot] Bot # @!attribute [rw] Log # @return [LogWrapper] Log # @!attribute [rw] path # @return [String] Path -# @!attribute [r] core +# @!attribute [rw] core # @return [Plugin] Core plugin class ProtonBot::Plugin - attr_reader :name, :version, :description, :plugins, :hooks, :core - attr_accessor :bot, :log, :path + attr_reader :name, :version, :description, :plugins, :hooks + attr_accessor :bot, :log, :path, :core # @param block [Proc] def initialize(&block) @hooks = [] @block = block @@ -31,10 +31,9 @@ # Starts plugin # @return [Plugin] self def launch @plugins = @bot.plugins - @core = @bot.plugins['core'] instance_exec(&@block) raise ProtonBot::PluginError, 'Plugin-name is not set!' unless @name raise ProtonBot::PluginError, 'Plugin-description is not set!' unless @description