lib/marvin/command_handler.rb in Sutto-marvin-0.8.0.0 vs lib/marvin/command_handler.rb in Sutto-marvin-0.8.0.1

- old
+ new

@@ -6,11 +6,10 @@ class_inheritable_accessor :command_prefix self.command_prefix = "" @@exposed_method_mapping = Hash.new { |h,k| h[k] = [] } @@method_descriptions = Hash.new { |h,k| h[k] = {} } - @@registered_classes = Set.new class << self def command(name, method_desc = nil, &blk) exposes name @@ -44,9 +43,15 @@ @last_description = description end def exposed_name(method) "#{command_prefix}#{method}" + end + + def reloading! + super + @@exposed_method_mapping.delete(self) + @@method_descriptions.delete(self) end end on_event :incoming_message, :check_for_commands \ No newline at end of file