Skip to content

Commit fa17d20

Browse files
authored
Merge pull request #21 from gtt-project/feature/support-zeitwerk
Support zeitwerk
2 parents 2b5dd59 + cb897c3 commit fa17d20

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ The Text Blocks Project appreciates any [contributions](https://github.com/gtt-p
3737

3838
## Version History
3939

40+
- 2.0.0 Support Redmine 5.0
41+
- 1.2.0 Publish on GitHub
4042
- 1.0.2 Fixes localization
4143
- 1.0.1 Bugfix
4244

init.rb

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
require 'redmine'
1+
require File.expand_path('../lib/redmine_text_blocks/view_hooks', __FILE__)
22

3-
Rails.configuration.to_prepare do
4-
RedmineTextBlocks.setup
3+
if Rails.version > '6.0' && Rails.autoloaders.zeitwerk_enabled?
4+
Rails.application.config.after_initialize do
5+
RedmineTextBlocks.setup
6+
end
7+
else
8+
require 'redmine_text_blocks'
9+
Rails.configuration.to_prepare do
10+
RedmineTextBlocks.setup
11+
end
512
end
613

714
Redmine::Plugin.register :redmine_text_blocks do
@@ -10,7 +17,7 @@
1017
author_url 'https://github.com/georepublic'
1118
url 'https://github.com/gtt-project/redmine_text_blocks'
1219
description 'Adds configurable text blocks for replying to issues'
13-
version '1.2.0'
20+
version '2.0.0'
1421

1522
requires_redmine version_or_higher: '4.0.0'
1623

lib/redmine_text_blocks.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
require 'redmine_text_blocks/view_hooks'
2-
31
module RedmineTextBlocks
42
def self.setup
53
RedmineTextBlocks::ProjectPatch.apply

0 commit comments

Comments
 (0)