forked from jbbarth/redmine_base_deface
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.rb
20 lines (19 loc) · 1.08 KB
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Redmine::Plugin.register :redmine_base_deface do
name 'Redmine Base Deface plugin'
author 'Jean-Baptiste BARTH'
description 'This is a plugin for Redmine'
version '0.0.1'
url 'https://github.com/jbbarth/redmine_base_deface'
author_url 'jeanbaptiste.barth@gmail.com'
#doesn't work since redmine evaluates dependencies as it loads, and loads in lexical order
#TODO: see if it works in Redmine 2.6.x or 3.x when they're released
# requires_redmine_plugin :redmine_base_rspec, :version_or_higher => '0.0.3' if Rails.env.test?
end
# Little hack for deface in redmine:
# - redmine plugins are not railties nor engines, so deface overrides are not detected automatically
# - deface doesn't support direct loading anymore ; it unloads everything at boot so that reload in dev works
# - hack consists in adding "app/overrides" path of all plugins in Redmine's main #paths
Rails.application.paths["app/overrides"] ||= []
Dir.glob("#{Rails.root}/plugins/*/app/overrides").each do |dir|
Rails.application.paths["app/overrides"] << dir unless Rails.application.paths["app/overrides"].include?(dir)
end