This repository has been archived by the owner on Oct 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
init.rb
45 lines (38 loc) · 1.49 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
45
require 'redmine'
begin
require 'octokit'
rescue LoadError
end
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'
Rails.logger.info 'Starting SCM Creator Plugin for Redmine'
Redmine::Scm::Base.add('Github')
Rails.configuration.to_prepare do
unless Project.included_modules.include?(ScmProjectPatch)
Project.send(:include, ScmProjectPatch)
end
unless RepositoriesHelper.included_modules.include?(ScmRepositoriesHelperPatch)
RepositoriesHelper.send(:prepend, ScmRepositoriesHelperPatch)
end
unless RepositoriesController.included_modules.include?(ScmRepositoriesControllerPatch)
RepositoriesController.send(:prepend, ScmRepositoriesControllerPatch)
end
unless Repository.included_modules.include?(ScmRepositoryPatch)
Repository.send(:include, ScmRepositoryPatch)
end
end
Redmine::Plugin.register :redmine_scm do
requires_redmine version_or_higher: '4.0'
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 'http://projects.andriylesyuk.com/projects/scm-creator'
version '0.5.1'
end