X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fdebugger.rb;h=c83aea4a58e680bbcf11cbb318e5f7d5fa596e99;hb=22e6cefa54de681b131ecb97fc9383ff5e990dfe;hp=2851d6a9ffd97aa1efbd78a8b847540e95534b78;hpb=d29df50ddaf32536b105decefb135a0b86ee937f;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/debugger.rb b/data/rbot/plugins/debugger.rb index 2851d6a9..c83aea4a 100644 --- a/data/rbot/plugins/debugger.rb +++ b/data/rbot/plugins/debugger.rb @@ -1,16 +1,20 @@ -# Debugging/profiling for rbot +#-- vim:sw=2:et +#++ # -# (c) 2006 Giuseppe Bilotta -# Licensed under GPL V2. +# :title: Debugging/profiling for rbot +# +# Author:: Giuseppe "Oblomov" Bilotta +# Copyright:: (C) 2006-2007 Giuseppe Bilotta +# License:: GPL v2 class DebugPlugin < Plugin - BotConfig.register BotConfigIntegerValue.new('debug.interval', + Config.register Config::IntegerValue.new('debug.interval', :default => 10, :validate => Proc.new{|v| v > 0}, :desc => "Number of seconds between memory profile dumps") - BotConfig.register BotConfigBooleanValue.new('debug.dump_strings', + Config.register Config::BooleanValue.new('debug.dump_strings', :default => false, :desc => "Set to true if you want the profiler to dump strings, false otherwise") - BotConfig.register BotConfigStringValue.new('debug.logdir', + Config.register Config::StringValue.new('debug.logdir', :default => "", :desc => "Directory where profile/string dumps are to be stored") @@ -44,7 +48,7 @@ class DebugPlugin < Plugin end @delta.clear - (@curr.keys + @delta.keys).uniq.each do |k,v| + (@curr.keys + @prev.keys).uniq.each do |k,v| @delta[k] = @curr[k]-@prev[k] end