diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-07-25 14:28:12 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-07-25 14:28:12 +0000 |
commit | e4f1c2db8337730ca3082844c0a4238a797650d7 (patch) | |
tree | 92982f1763b10f491772cf87c12280f18476a161 | |
parent | 93379409daaf8e8bee05aa3465a0fcc45e6245ae (diff) |
Fix a bug in {{{help pluginfailures}}}
-rw-r--r-- | lib/rbot/plugins.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb index 0e9d4cdf..befe06ed 100644 --- a/lib/rbot/plugins.rb +++ b/lib/rbot/plugins.rb @@ -248,9 +248,10 @@ module Plugins } newerr = err.class.new(msg) newerr.set_backtrace(bt) - debug "Simplified error: " << newerr.inspect - debug newerr.backtrace.join("\n") + # debug "Simplified error: " << newerr.inspect + # debug newerr.backtrace.join("\n") @failed << { :name => tmpfilename, :err => newerr } + # debug "Failures: #{@failed.inspect}" end } end @@ -296,10 +297,12 @@ module Plugins # return help for +topic+ (call associated plugin's help method) def help(topic="") if topic == "pluginfailures" + # debug "Failures: #{@failed.inspect}" return "no plugins failed to load" if @failed.empty? - return (@failed.inject([]) { |list, p| + return (@failed.inject(Array.new) { |list, p| list << "#{Bold}#{p[:name]}#{Bold} failed with #{p[:err].class}: #{p[:err]}" list << "#{Bold}#{p[:name]}#{Bold} failed at #{p[:err].backtrace.join(', ')}" unless p[:err].backtrace.empty? + list }).join("\n") end if(topic =~ /^(\S+)\s*(.*)$/) |