redmine_plugins_helper 0.15.5 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1add4932b8b4f0b0e829bf34a2ec415c067eb95ddec4c7d108670b2772ff808
4
- data.tar.gz: a52294bb948a3496b0f64b3e15e58ecaf6cf2b65d02cc02fb7c78619ff200f5c
3
+ metadata.gz: e8ac62d4b7fa89f7281238f4b8b533b5680458f5462ec11dcc7ad20f48af5220
4
+ data.tar.gz: 5de46ceb6af95389a4d7d1f1e97df2dd986d7d152f7ffe17b183122f60b1b5f9
5
5
  SHA512:
6
- metadata.gz: 82502c187d66a509e7c681f8867ca34371d547cb5e8815826bc440bf388c731e0fd5a93ec68d775e0fda499e06dd5beffe61a5fa27efdac03480ea0c98a65662
7
- data.tar.gz: 8f2e02bfae051e423a01f0c5ebea007015c09fbb3b4f0af5fc599c92cd8c7a89ae74b57bbce3d5d8ba13e46235b51f4f82850b1ac086cd44f00c2f54c76f2239
6
+ metadata.gz: 62099ac1733c8802426f7eb7ddf9ec694de1fad26bee1d0f95ab9641af58e4ef637de852e1664520bbece78458f4d008d8eef517f0e6ff707075d7d335bb62cc
7
+ data.tar.gz: 59a61d3485db4073c1d5cf11d65776e46880a576255eb13ed5475491999d61433b9a18111652cf424389dbb8ae4c21e40f344005b45c2d1d15f6da63da3287b8
data/init.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require 'redmine'
4
4
  require 'redmine_plugins_helper/version'
5
5
  require 'redmine_plugins_helper/patches/test_case_patch'
6
+ require 'redmine_plugins_helper/hooks/after_plugins_loaded'
6
7
 
7
8
  Redmine::Plugin.register :redmine_plugins_helper do
8
9
  name 'Redmine Plugins\' Helper'
@@ -10,9 +11,3 @@ Redmine::Plugin.register :redmine_plugins_helper do
10
11
  description RedminePluginsHelper::SUMMARY
11
12
  version RedminePluginsHelper::VERSION
12
13
  end
13
-
14
- Rails.configuration.to_prepare do
15
- require_dependency 'redmine_plugins_helper/patches'
16
- Redmine::Plugin.all.sort.each(&:add_assets_paths)
17
- Redmine::Plugin.all.sort.each(&:load_initializers)
18
- end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RedminePluginsHelper
4
+ module Hooks
5
+ class AfterPluginsLoaded < Redmine::Hook::Listener
6
+ def after_plugins_loaded(_context = {})
7
+ require 'redmine_plugins_helper/patches'
8
+ Redmine::Plugin.all.sort.each(&:add_assets_paths)
9
+ Redmine::Plugin.all.sort.each(&:load_initializers)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -19,7 +19,7 @@ module RedminePluginsHelper
19
19
  nyi unless plugin?
20
20
 
21
21
  ::Redmine::Plugin::Migrator.current_plugin = plugin
22
- ::Redmine::Plugin::MigrationContext.new(plugin.migration_directory).up do |m|
22
+ ::Redmine::Plugin::MigrationContext.new(*migrator_context_args).up do |m|
23
23
  m.version == version
24
24
  end
25
25
  end
@@ -49,5 +49,16 @@ module RedminePluginsHelper
49
49
  def plugin?
50
50
  !core?
51
51
  end
52
+
53
+ protected
54
+
55
+ # @return [Enumerable<Object>]
56
+ def migrator_context_args
57
+ if ::Rails.version < '6'
58
+ [plugin.migration_directory]
59
+ else
60
+ [plugin.migration_directory, ActiveRecord::Base.connection.schema_migration]
61
+ end
62
+ end
52
63
  end
53
64
  end
@@ -3,5 +3,8 @@
3
3
  module RedminePluginsHelper
4
4
  AUTHOR = 'Eduardo Henrique Bogoni'
5
5
  SUMMARY = 'Helper for Redmine plugins'
6
- VERSION = '0.15.5'
6
+ VERSION = '0.16.0'
7
+
8
+ module Version
9
+ end
7
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_plugins_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.5
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
- - 0.15.5
7
+ - 0.16.0
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-21 00:00:00.000000000 Z
11
+ date: 2025-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal
@@ -115,6 +115,7 @@ files:
115
115
  - lib/redmine_plugins_helper/available.rb
116
116
  - lib/redmine_plugins_helper/fix_migrations.rb
117
117
  - lib/redmine_plugins_helper/hooks/add_assets.rb
118
+ - lib/redmine_plugins_helper/hooks/after_plugins_loaded.rb
118
119
  - lib/redmine_plugins_helper/migrate.rb
119
120
  - lib/redmine_plugins_helper/migration.rb
120
121
  - lib/redmine_plugins_helper/migration/code.rb