summaryrefslogtreecommitdiffstats
path: root/lib/redmine/scm/base.rb
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-02-16 22:41:59 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-02-16 22:41:59 +0000
commit9e22faa640c0d1707da4c2203a6e3f936683b4c9 (patch)
tree81b68a05472ae9559545d7b97c504e6d521a39fe /lib/redmine/scm/base.rb
parentb3330d399543878c2e49df16ed4b73add9afd560 (diff)
downloadredmine-9e22faa640c0d1707da4c2203a6e3f936683b4c9.tar.gz
redmine-9e22faa640c0d1707da4c2203a6e3f936683b4c9.zip
Converted the REDMINE_SUPPORTED_SCM constant to a class
Now SCMs can be added or removed using a simple API, instead of being hardcoded: Redmine::Scm::Base.add('ScmName') Redmine::Scm::Base.delete('ScmName') git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3440 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/scm/base.rb')
-rw-r--r--lib/redmine/scm/base.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/redmine/scm/base.rb b/lib/redmine/scm/base.rb
new file mode 100644
index 000000000..43e8a1877
--- /dev/null
+++ b/lib/redmine/scm/base.rb
@@ -0,0 +1,23 @@
+module Redmine
+ module Scm
+ class Base
+ class << self
+
+ def all
+ @scms
+ end
+
+ # Add a new SCM adapter and repository
+ def add(scm_name)
+ @scms ||= []
+ @scms << scm_name
+ end
+
+ # Remove a SCM adapter from Redmine's list of supported scms
+ def delete(scm_name)
+ @scms.delete(scm_name)
+ end
+ end
+ end
+ end
+end