]> source.dussan.org Git - redmine.git/commitdiff
Add plugins information to script/about (#3387).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 25 May 2009 19:10:26 +0000 (19:10 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 25 May 2009 19:10:26 +0000 (19:10 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2766 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/about.rb [new file with mode: 0644]
script/about

diff --git a/lib/redmine/about.rb b/lib/redmine/about.rb
new file mode 100644 (file)
index 0000000..0fcc29a
--- /dev/null
@@ -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
index ed8deb0dfc0e593c08c86a3aed22a6d3f0717231..9f7dff2f1ee8b65d9963450de7fda299491b045a 100755 (executable)
@@ -1,4 +1,6 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
-require 'commands/about'
\ No newline at end of file
+#!/usr/bin/env ruby\r
+require File.dirname(__FILE__) + '/../config/boot'\r
+$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"\r
+require 'commands/about'\r
+\r
+Redmine::About.print_plugin_info\r