-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinit.rb
48 lines (41 loc) · 1.05 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
# encoding: utf-8
require 'redmine'
begin
require 'config/initializers/session_store.rb'
rescue LoadError
end
def init_repeat
Dir::foreach(File.join(File.dirname(__FILE__), 'lib')) do |file|
next unless /\.rb$/ =~ file
require_dependency file
end
end
if Rails::VERSION::MAJOR >= 5
ActiveSupport::Reloader.to_prepare do
init_repeat
end
elsif Rails::VERSION::MAJOR >= 3
ActionDispatch::Callbacks.to_prepare do
init_repeat
end
else
Dispatcher.to_prepare :redmine_indicator do
init_repeat
end
end
Rails.application.config.to_prepare do
RedmineIndicator.apply_patch
end
# for redmine 5
Rails.application.config.after_initialize do
RedmineIndicator.apply_patch
end
Redmine::Plugin.register :redmine_indicator do
name 'Redmine Indicator'
author 'Frederic Aoustin'
description 'The redmine_indicator add block with main indicator on my page and project page'
version '0.2.16'
url 'https://github.com/fraoustin/redmine_indicator'
author_url 'https://github.com/fraoustin'
requires_redmine :version_or_higher => '2.3.0'
end