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
This commit is contained in:
Eric Davis committed 2010-02-16 22:41:59 +00:00
1 parent b3330d3995
commit 9e22faa640
5 files changed
+34 -4

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@ class ApplicationController < ActionController::Base
include Redmine::MenuManager::MenuController
helper Redmine::MenuManager::MenuHelper
REDMINE_SUPPORTED_SCM.each do |scm|
Redmine::Scm::Base.all.each do |scm|
require_dependency "repository/#{scm.underscore}"
end
+1 -1
View File
@@ -126,7 +126,7 @@ module RepositoriesHelper
def scm_select_tag(repository)
scm_options = [["--- #{l(:actionview_instancetag_blank_option)} ---", '']]
REDMINE_SUPPORTED_SCM.each do |scm|
Redmine::Scm::Base.all.each do |scm|
scm_options << ["Repository::#{scm}".constantize.scm_name, scm] if Setting.enabled_scm.include?(scm) || (repository && repository.class.name.demodulize == scm)
end
+1 -1
View File
@@ -13,7 +13,7 @@
<%= link_to_function l(:label_generate_key), "if ($('settings_sys_api_key').disabled == false) { $('settings_sys_api_key').value = randomKey(20) }" %>
</p>
<p><%= setting_multiselect(:enabled_scm, REDMINE_SUPPORTED_SCM) %></p>
<p><%= setting_multiselect(:enabled_scm, Redmine::Scm::Base.all) %></p>
<p><%= setting_text_field :repositories_encodings, :size => 60 %><br />
<em><%= l(:text_comma_separated) %></em></p>