Add plugins information to script/about (#3387).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2766 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2009-05-25 19:10:26 +00:00
parent 85ce903cfa
commit 53b002b497
2 changed files with 22 additions and 4 deletions

16
lib/redmine/about.rb Normal file
View File

@ -0,0 +1,16 @@
module Redmine
class About
def self.print_plugin_info
plugins = Redmine::Plugin.registered_plugins
if !plugins.empty?
column_with = plugins.map {|internal_name, plugin| plugin.name.length}.max
puts "\nAbout your Redmine plugins"
plugins.each do |internal_name, plugin|
puts sprintf("%-#{column_with}s %s", plugin.name, plugin.version)
end
end
end
end
end

View File

@ -2,3 +2,5 @@
require File.dirname(__FILE__) + '/../config/boot'
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
require 'commands/about'
Redmine::About.print_plugin_info