-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathinit.rb
54 lines (45 loc) · 1.87 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
46
47
48
49
50
51
52
53
54
# Copyright (C) 2012-2013 Harry Garrood
# This file is a part of redmine_release_notes.
# redmine_release_notes is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
# redmine_release_notes is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
# You should have received a copy of the GNU General Public License along with
# redmine_release_notes. If not, see <http://www.gnu.org/licenses/>.
require 'redmine'
require 'redmine_release_notes/hooks'
ActionDispatch::Callbacks.to_prepare do
# Patches to the Redmine core.
patched_classes = %w(issue issues_controller settings_controller version)
patched_classes.each do |core_class|
require_dependency core_class
"RedmineReleaseNotes::#{core_class.camelize}Patch".constantize.perform
end
end
Redmine::Plugin.register :redmine_release_notes do
name 'Redmine release notes plugin'
author 'Harry Garrood'
description 'A plugin for managing release notes.'
version '1.3.1'
author_url 'https://github.com/hdgarrood'
requires_redmine :version_or_higher => '2.1.0'
# the partial won't be used, but can't be blank, because Redmine needs to
# think this plugin is configurable
settings :default => {
:default_generation_format_id => 1,
:issue_custom_field_id => 0,
:field_value_todo => 'Todo',
:field_value_done => 'Done',
:field_value_not_required => 'Not required'
},
:partial => 'not_blank'
project_module :release_notes do
permission :release_notes,
{ :release_notes => [:index, :new, :generate] },
:public => true
end
end