]> source.dussan.org Git - redmine.git/commitdiff
Add Redmine::Plugin.installed?(:name) method to check if a plugin is installed
authorEric Davis <edavis@littlestreamsoftware.com>
Mon, 25 Oct 2010 23:32:01 +0000 (23:32 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Mon, 25 Oct 2010 23:32:01 +0000 (23:32 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4293 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/plugin.rb

index 11255e02d3a5b2b860009a2e76401309bebd6cd4..f30277ad1da7b988be83f9fa61756bf3e0fb06fa 100644 (file)
@@ -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