summaryrefslogtreecommitdiffstats
path: root/lib/redmine/plugin.rb
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-10-25 23:32:01 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-10-25 23:32:01 +0000
commitc399e7632478fbd4ab94a52d68f4b6198142be35 (patch)
treecf208b56e32b6fa22fce1c3535f9baf316814c29 /lib/redmine/plugin.rb
parent397222f1984b7d00a88b718d4a97ce40ccabbedd (diff)
downloadredmine-c399e7632478fbd4ab94a52d68f4b6198142be35.tar.gz
redmine-c399e7632478fbd4ab94a52d68f4b6198142be35.zip
Add Redmine::Plugin.installed?(:name) method to check if a plugin is installed
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4293 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/plugin.rb')
-rw-r--r--lib/redmine/plugin.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb
index 11255e02d..f30277ad1 100644
--- a/lib/redmine/plugin.rb
+++ b/lib/redmine/plugin.rb
@@ -89,6 +89,13 @@ module Redmine #:nodoc:
def self.clear
@registered_plugins = {}
end
+
+ # Checks if a plugin is installed
+ #
+ # @param [String] id name of the plugin
+ def self.installed?(id)
+ registered_plugins[id.to_sym].present?
+ end
def initialize(id)
@id = id.to_sym