forked from ayaye/redmine_scm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.rb
44 lines (37 loc) · 1.52 KB
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
require 'redmine'
begin
require 'octokit'
rescue LoadError
end
Rails.logger.info 'Starting SCM Creator Plugin for Redmine'
Redmine::Scm::Base.add('Github')
((Rails.version > "5")? ActiveSupport::Reloader : ActionDispatch::Callbacks).to_prepare do
require_dependency 'creator/scm_creator'
require_dependency 'creator/subversion_creator'
require_dependency 'creator/mercurial_creator'
require_dependency 'creator/git_creator'
require_dependency 'creator/bazaar_creator'
require_dependency 'creator/github_creator'
require_dependency 'scm_config'
require_dependency 'scm_hook'
unless Project.included_modules.include?(ScmProjectPatch)
Project.send(:include, ScmProjectPatch)
end
unless Repository.included_modules.include?(ScmRepositoryPatch)
Repository.send(:include, ScmRepositoryPatch)
end
unless RepositoriesHelper.included_modules.include?(ScmRepositoriesHelperPatch)
RepositoriesHelper.send(:include, ScmRepositoriesHelperPatch)
end
unless RepositoriesController.included_modules.include?(ScmRepositoriesControllerPatch)
RepositoriesController.send(:include, ScmRepositoriesControllerPatch)
end
end
Redmine::Plugin.register :redmine_scm do
name 'SCM Creator'
author 'Andriy Lesyuk'
author_url 'http://www.andriylesyuk.com/'
description 'Allows creating Subversion, Git, Mercurial, Bazaar and Github repositories within Redmine.'
url 'https://github.com/ayaye/redmine_scm/'
version '0.6.0'
end