redmine_plugin_kit 1.0.5 → 1.0.7

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: 8e0b142f30bff45473f37525cab7f17fb7eaa515b4edb0bd6d2c385c37693978
4
- data.tar.gz: da108a048156e659cf74942e187eadfcca81655e9d4285b3a346259de2898f6e
3
+ metadata.gz: b46d9687fc10c651bf9b97d521c32626da3aa512e4a6b35129853b392373c9e6
4
+ data.tar.gz: 82fff5a7d015c429fc2aace8aa21487e4926834ce12f531b4c1730c6ded1bd07
5
5
  SHA512:
6
- metadata.gz: b6f7a93ce509a493391e23a89564573edfec8969c69d0d7bef3172b04c52439463b9b8d486f83dca5879e5fdea38abad94322781f6a08e7b78b9295209a32608
7
- data.tar.gz: 96746fae6e4aacbc2646a6e18ebf500c22a017e7ce32cbbcf32e957ec437c20b736059449bd9d86d5a64521cde6ce8f7ab9ed23820d6a3aeef0c2682514fef91
6
+ metadata.gz: 52ec1ea4baa451f343576dde3901619d30d2c7b7cacba46c9bdc40af8fab0f80b8db4fd2a1d07b75465d9b071e2d5677cdb81ad8f5b3f46b53f0fbe90fd8bc68
7
+ data.tar.gz: 9380da6c43ed0da0c0b2cad2ca90f179fda32ae7b6f6a86d47381414fcdca4aaba2e9e66e78af4a039f2cb318469a821f5f20b6600b137de3310a2e440df6e7c
@@ -15,7 +15,7 @@ module RedminePluginKit
15
15
  return if url.blank?
16
16
 
17
17
  parts = url.split '://'
18
- name = if parts.count.positive?
18
+ name = if parts.any?
19
19
  parts.shift
20
20
  parts.join.chomp '/'
21
21
  else
@@ -11,6 +11,7 @@ module RedminePluginKit
11
11
  init_loader existing_loader
12
12
  raise "no loader for #{plugin_id}" if loader.nil?
13
13
 
14
+ setup_required_plugins
14
15
  setup
15
16
  end
16
17
 
@@ -37,6 +38,24 @@ module RedminePluginKit
37
38
 
38
39
  private
39
40
 
41
+ # rubocop: disable Style/RaiseArgs
42
+ def setup_required_plugins
43
+ return unless defined? self::REQUIRED_ALPHANODES_PLUGINS
44
+ raise 'VERSION missing for REQUIRED_ALPHANODES_PLUGINS' unless defined? self::VERSION
45
+
46
+ self::REQUIRED_ALPHANODES_PLUGINS.each do |required_plugin|
47
+ plugin = Redmine::Plugin.find required_plugin
48
+ unless self::VERSION.include? plugin.version
49
+ raise Redmine::PluginRequirementError.new "#{plugin_id} plugin requires #{required_plugin} plugin version #{self::VERSION}"
50
+ end
51
+ rescue Redmine::PluginNotFound
52
+ raise Redmine::PluginRequirementError.new "#{plugin_id} plugin requires the #{required_plugin} plugin." \
53
+ "Please install #{required_plugin} plugin (https://alphanodes.com/#{required_plugin.tr '-',
54
+ '_'})"
55
+ end
56
+ end
57
+ # rubocop: enable Style/RaiseArgs
58
+
40
59
  def init_loader(existing_loader)
41
60
  @loader = existing_loader
42
61
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RedminePluginKit
4
- VERSION = '1.0.5'
4
+ VERSION = '1.0.7'
5
5
  end
@@ -79,4 +79,39 @@ namespace :redmine_plugin_kit do
79
79
  puts plugin_settings[setting]
80
80
  end
81
81
  end
82
+
83
+ desc 'Detects templates from the plugin that override Redmine core templates'
84
+ task detect_overwritten_templates: :environment do
85
+ redmine_views_root = Rails.root.join 'app/views'
86
+
87
+ Rails.root.glob('plugins/*').each do |plugin_path|
88
+ plugin_path = plugin_path.to_s
89
+ plugin_views = Dir.glob "#{plugin_path}/app/views/**/*.{erb,slim}"
90
+ overwritten = []
91
+
92
+ plugin_views.each do |plugin_file|
93
+ relative_path = plugin_file.sub %r{^#{Regexp.escape plugin_path}/app/views/}, ''
94
+ base_path = relative_path.sub(/\.(erb|slim)$/, '')
95
+ redmine_template = redmine_views_root.join "#{base_path}.erb"
96
+
97
+ overwritten << "app/views/#{base_path}.erb" if File.exist? redmine_template
98
+ end
99
+
100
+ output_file = File.join plugin_path, '.overwritten_templates'
101
+ previous_content = if File.exist? output_file
102
+ lines = File.read(output_file).lines.map(&:strip)
103
+ lines.sort
104
+ else
105
+ []
106
+ end
107
+ new_content = overwritten.sort
108
+
109
+ if previous_content == new_content
110
+ puts "✔️ No changes for: #{File.basename plugin_path}"
111
+ else
112
+ File.write output_file, "#{new_content.join "\n"}\n"
113
+ puts "✅ Updated: #{output_file}"
114
+ end
115
+ end
116
+ end
82
117
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_plugin_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - AlphaNodes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-29 00:00:00.000000000 Z
11
+ date: 2025-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -56,7 +56,6 @@ files:
56
56
  - lib/redmine_plugin_kit/plugin_base.rb
57
57
  - lib/redmine_plugin_kit/version.rb
58
58
  - lib/tasks/redmine_plugin_kit.rake
59
- - redmine_plugin_kit-1.0.4.gem
60
59
  homepage: https://github.com/alphanodes/redmine_plugin_kit
61
60
  licenses:
62
61
  - GPL-2.0
Binary file