summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/plugins.rb22
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb
index 80ac2f1c..7b476da9 100644
--- a/lib/rbot/plugins.rb
+++ b/lib/rbot/plugins.rb
@@ -531,15 +531,19 @@ module Plugins
}.join("\n")
when /ignored?\s*plugins?/
return "no plugins were ignored" if @ignored.empty?
- return @ignored.inject(Array.new) { |list, p|
- case p[:reason]
- when :loaded
- list << "#{p[:name]} in #{p[:dir]} (overruled by previous)"
- else
- list << "#{p[:name]} in #{p[:dir]} (#{p[:reason].to_s})"
- end
- list
- }.join(", ")
+
+ tmp = Hash.new
+ @ignored.each do |p|
+ reason = p[:loaded] ? 'overruled by previous' : p[:reason].to_s
+ ((tmp[p[:dir]] ||= Hash.new)[reason] ||= Array.new).push(p[:name])
+ end
+
+ return tmp.map do |dir, reasons|
+ s = reasons.map { |r, list|
+ list.map { |_| _.sub(/\.rb$/, '') }.join(', ') + " (#{r})"
+ }.join('; ')
+ "in #{dir}: #{s}"
+ end.join('; ')
when /^(\S+)\s*(.*)$/
key = $1
params = $2